From 11de77f63f2f9f555977aac3e918e8e546a4c03b Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Mon, 14 Nov 2016 05:39:48 -0800 Subject: [PATCH] Adding debugging for body errors (#4542) --- webapp/client/client.jsx | 12 +++++++++++- webapp/client/web_client.jsx | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index a615bd5011..3ce6977f60 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -206,7 +206,12 @@ export default class Client { } if (successCallback) { - successCallback(res.body, res); + if (res.body) { + successCallback(res.body, res); + } else { + console.error('Missing response body for ' + methodName); // eslint-disable-line no-console + successCallback('', res); + } } } @@ -1952,6 +1957,11 @@ export default class Client { if (err) { return error(err); } + + if (!res.body) { + console.error('Missing response body for samlCertificateStatus'); // eslint-disable-line no-console + } + return success(res.body); }); } diff --git a/webapp/client/web_client.jsx b/webapp/client/web_client.jsx index d6474f1d97..5d2696c37c 100644 --- a/webapp/client/web_client.jsx +++ b/webapp/client/web_client.jsx @@ -92,6 +92,11 @@ class WebClientClass extends Client { if (err) { return error(err); } + + if (!res.body) { + console.error('Missing response body for getYoutubeVideoInfo'); // eslint-disable-line no-console + } + return success(res.body); }); }