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