[Pkg-javascript-commits] [dojo] 102/149: better error handling for http errors codes in nodejs, fixes #18475

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository dojo.

commit cd249b1068cfb45494e9b0cd0ed5c0555b166aa9
Author: Leo Huber <leo_huber at me.com>
Date:   Tue Dec 22 12:30:45 2015 -0700

    better error handling for http errors codes in nodejs, fixes #18475
---
 request/node.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/request/node.js b/request/node.js
index 8b9d5b6..f7197a9 100644
--- a/request/node.js
+++ b/request/node.js
@@ -92,6 +92,12 @@ define([
 					clearTimeout(timeout);
 				}
 				response.text = body.join('');
+				if (util.checkStatus(response.status)){
+					def.reject({
+						message: 'http response code ' +  response.status,
+						response: response
+					});
+				};
 				try{
 					handlers(response);
 					def.resolve(response);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list