diff --git a/lib/index.js b/lib/index.js index 6b1fe51..56cc765 100644 --- a/lib/index.js +++ b/lib/index.js @@ -38,7 +38,14 @@ Crowdin.prototype.requestData = function(params) { }) // Parse JSON .then(function(body) { - if (body) return JSON.parse(body); + if (body) { + try { + return JSON.parse(body); + } + catch (e) { + return body; + } + } return {}; }) // Throw error if present