Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
add error traps and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sethbattin committed Jun 17, 2017
1 parent 13086d0 commit 641ad3e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/gluestick/shared/lib/getHttpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,17 @@ export default function getHttpClient(
// not in gsBeforeRoute for apps where that is an issue.
const mergedCookieString: string = merge(incomingCookies, cookieString);
const cookies: Object[] = parse(mergedCookieString);
res.removeHeader('Set-Cookie');
try {
res.removeHeader('Set-Cookie');
} catch (e) {
console.error(e.message ? e.message : e);
}
cookies.forEach((cookie: Object) => {
res.append('Set-Cookie', cookie.toString());
try {
res.append('Set-Cookie', cookie.toString());
} catch (e) {
console.error(e.message ? e.message : e, cookie.name);
}
});

// Ensure that any subsequent requests are passing the cookies.
Expand Down

0 comments on commit 641ad3e

Please # to comment.