Commit e34cc4eb authored by Tristan Cavelier's avatar Tristan Cavelier

little to guess command action according to http status added

parent d2c5f881
/*jslint indent: 2, maxlen: 80, nomen: true, sloppy: true */ /*jslint indent: 2, maxlen: 80, nomen: true, sloppy: true */
/*global exports, Blob, FileReader, Deferred, hex_sha256, XMLHttpRequest */ /*global exports, Blob, FileReader, Deferred, hex_sha256, XMLHttpRequest,
constants */
/** /**
* Do not exports these tools unless they are not writable, not configurable. * Do not exports these tools unless they are not writable, not configurable.
...@@ -424,3 +425,14 @@ function methodType(method) { ...@@ -424,3 +425,14 @@ function methodType(method) {
return 'unknown'; return 'unknown';
} }
} }
/**
* Return 'success', 'error' or 'retry' according to a http status.
*
* @param {Number} status The http status
* @return {String} The command action string
*/
function guessCommandFromStatus(status) {
return constants.http_action[status || 0];
}
exports.util.guessCommandFromStatus = guessCommandFromStatus;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment