feature #239: add enumeration style object for error codes

This commit is contained in:
Sefa Ilkimen
2019-09-26 03:00:30 +02:00
parent 4b73c3762c
commit 2ce1fc407d
5 changed files with 24 additions and 4 deletions
+12 -2
View File
@@ -1,5 +1,14 @@
module.exports = function init(exec, cookieHandler, urlUtil, helpers, globalConfigs) {
const publicInterface = {
var ErrorCode = {
Generic: -1,
SslException: -2,
ServerNotFound: -3,
Timeout: -4,
UnsupportedUrl: -5,
NotConnected: -6,
};
var publicInterface = {
getBasicAuthHeader: getBasicAuthHeader,
useBasicAuth: useBasicAuth,
getHeaders: getHeaders,
@@ -28,7 +37,8 @@ module.exports = function init(exec, cookieHandler, urlUtil, helpers, globalConf
delete: del,
head: head,
uploadFile: uploadFile,
downloadFile: downloadFile
downloadFile: downloadFile,
ErrorCode: ErrorCode
};
function getBasicAuthHeader(username, password) {