From a53e98e6582c1d9ac92f35a6e26527d14efedc19 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 d53a10021..f7ee7dc4e 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: Error) { + 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: Error) { + console.error(e.message ? e.message : e, cookie.name); + } }); // Ensure that any subsequent requests are passing the cookies.