mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
feature #239: add enumeration style object for error codes
This commit is contained in:
+12
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user