- 1 :
- 2 :
- 3 :
(function(root, factory) {
- 4 :
- 5 :
if (typeof module === 'object' && module.exports) {
- 6 :
// CommonJS-like environments that support module.exports, like Node.
- 7 :
module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
- 8 :
}
- 9 :
}(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
- 10 :
'use strict';
- 11 :
- 12 :
/**
- 13 :
* The Error wrapper module.
- 14 :
* @module wrappers/Error
- 15 :
*/
- 16 :
var exports = function() {
- 17 :
- 18 :
};
- 19 :
exports.constructFromObject = function (data, obj) {
- 20 :
if (data) {
- 21 :
obj = obj || new exports();
- 22 :
if (data.hasOwnProperty('code')) {
- 23 :
obj['code'] = data['code'];
- 24 :
}
- 25 :
if (data.hasOwnProperty('message')) {
- 26 :
obj['message'] = data['message'];
- 27 :
}
- 28 :
if (data.hasOwnProperty('field')) {
- 29 :
obj['field'] = data['field'];
- 30 :
}
- 31 :
}
- 32 :
return obj;
- 33 :
};
- 34 :
- 35 :
- 36 :
exports.prototype = Object.create(Base.prototype);
- 37 :
exports.prototype.constructor = exports;
- 38 :
- 39 :
/**
- 40 :
* A string indicating error
- 41 :
* @member {String} code
- 42 :
*/
- 43 :
exports.prototype['code'] = undefined;
- 44 :
/**
- 45 :
* A human-readable message providing more details about the error.
- 46 :
* @member {String} message
- 47 :
*/
- 48 :
exports.prototype['message'] = undefined;
- 49 :
/**
- 50 :
* Refers to the field in the request, if the error is specific to it.
- 51 :
* @member {String} field
- 52 :
*/
- 53 :
exports.prototype['field'] = undefined;
- 54 :
- 55 :
- 56 :
- 57 :
- 58 :
return exports;
- 59 :
- 60 :
}));