oxford-dictionary
Advanced tools
Comparing version 1.5.1 to 1.6.0
23
index.js
@@ -147,2 +147,21 @@ var https = require('https'); | ||
} | ||
if (res.statusCode == 403) { | ||
return reject("Authentication failed. Remember V2 is not accessible with FREE tier."); | ||
} | ||
if (res.statusCode == 414) { | ||
return reject("URI too long. Your word_id exceeds the maximum 128 characters."); | ||
} | ||
if (res.statusCode == 500) { | ||
return reject("Internal Server Error. Contact the Oxford Dictionary API team"); | ||
} | ||
if (res.statusCode == 502) { | ||
return reject("Bad Gateway. Oxford Dictionaries API is down or being upgraded."); | ||
} | ||
if (res.statusCode == 503) { | ||
return reject("Service Unavailable. The Oxford Dictionaries API servers are up, but overloaded with requests. Please try again later."); | ||
} | ||
if (res.statusCode == 504) { | ||
return reject("Gateway timeout. The Oxford Dictionaries API servers are up, but the request couldn’t be serviced due to some failure within our stack. Please try again later."); | ||
} | ||
var data = ""; | ||
@@ -160,4 +179,4 @@ | ||
result = { | ||
'status_code': 500, | ||
'status_text': 'JSON Parse Failed' | ||
'status_code': 418, | ||
'status_text': 'JSON Parse Failed. Unable to parse response.' | ||
}; | ||
@@ -164,0 +183,0 @@ reject(result); |
{ | ||
"name": "oxford-dictionary", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "A nodeJS wrapper for using the oxforddictionary.com REST API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
20960
181