From 88bebb4e148ed0dc1a263776aee49beeee3c0ad8 Mon Sep 17 00:00:00 2001 From: Seth Battin Date: Sat, 17 Jun 2017 16:19:34 -0500 Subject: [PATCH] add error traps and logs --- packages/gluestick/shared/lib/getHttpClient.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/gluestick/shared/lib/getHttpClient.js b/packages/gluestick/shared/lib/getHttpClient.js index d53a1002..ce63a276 100644 --- a/packages/gluestick/shared/lib/getHttpClient.js +++ b/packages/gluestick/shared/lib/getHttpClient.js @@ -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.