From 04f457550ed92777fdb2e116bfb89d77a7a8498d Mon Sep 17 00:00:00 2001 From: Matheus Fernandes Date: Wed, 3 May 2017 19:49:07 -0700 Subject: [PATCH] Log the body of the request when the first step of a login fails --- lib/login.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/login.js b/lib/login.js index b1719b1..46e1063 100644 --- a/lib/login.js +++ b/lib/login.js @@ -27,10 +27,11 @@ async function getVerificationData(url, email) { body: data }) - const body = await res.json() if (res.status !== 200) { - throw new Error(`Verification error: ${res.status} – ${body}`) + throw new Error( + `Verification error: ${res.status} – ${JSON.stringify(body)}` + ) } return body }