ParseError.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. "use strict";
  2. var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
  3. var _Object$defineProperty2 = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
  4. var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
  5. _Object$defineProperty2(exports, "__esModule", {
  6. value: true
  7. });
  8. exports.default = void 0;
  9. var _defineProperty = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property"));
  10. var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
  11. var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
  12. var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
  13. var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
  14. var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
  15. var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
  16. var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/wrapNativeSuper"));
  17. function _createSuper(Derived) {
  18. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  19. return function () {
  20. var Super = (0, _getPrototypeOf2.default)(Derived),
  21. result;
  22. if (hasNativeReflectConstruct) {
  23. var NewTarget = (0, _getPrototypeOf2.default)(this).constructor;
  24. result = _Reflect$construct(Super, arguments, NewTarget);
  25. } else {
  26. result = Super.apply(this, arguments);
  27. }
  28. return (0, _possibleConstructorReturn2.default)(this, result);
  29. };
  30. }
  31. function _isNativeReflectConstruct() {
  32. if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
  33. if (_Reflect$construct.sham) return false;
  34. if (typeof Proxy === "function") return true;
  35. try {
  36. Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
  37. return true;
  38. } catch (e) {
  39. return false;
  40. }
  41. }
  42. /**
  43. * Constructs a new Parse.Error object with the given code and message.
  44. *
  45. * @alias Parse.Error
  46. */
  47. var ParseError = /*#__PURE__*/function (_Error) {
  48. (0, _inherits2.default)(ParseError, _Error);
  49. var _super = _createSuper(ParseError);
  50. /**
  51. * @param {number} code An error code constant from <code>Parse.Error</code>.
  52. * @param {string} message A detailed description of the error.
  53. */
  54. function ParseError(code, message) {
  55. var _this;
  56. (0, _classCallCheck2.default)(this, ParseError);
  57. _this = _super.call(this, message);
  58. _this.code = code;
  59. (0, _defineProperty.default)((0, _assertThisInitialized2.default)(_this), 'message', {
  60. enumerable: true,
  61. value: message
  62. });
  63. return _this;
  64. }
  65. (0, _createClass2.default)(ParseError, [{
  66. key: "toString",
  67. value: function () {
  68. return 'ParseError: ' + this.code + ' ' + this.message;
  69. }
  70. }]);
  71. return ParseError;
  72. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  73. /**
  74. * Error code indicating some error other than those enumerated here.
  75. *
  76. * @property {number} OTHER_CAUSE
  77. * @static
  78. */
  79. ParseError.OTHER_CAUSE = -1;
  80. /**
  81. * Error code indicating that something has gone wrong with the server.
  82. *
  83. * @property {number} INTERNAL_SERVER_ERROR
  84. * @static
  85. */
  86. ParseError.INTERNAL_SERVER_ERROR = 1;
  87. /**
  88. * Error code indicating the connection to the Parse servers failed.
  89. *
  90. * @property {number} CONNECTION_FAILED
  91. * @static
  92. */
  93. ParseError.CONNECTION_FAILED = 100;
  94. /**
  95. * Error code indicating the specified object doesn't exist.
  96. *
  97. * @property {number} OBJECT_NOT_FOUND
  98. * @static
  99. */
  100. ParseError.OBJECT_NOT_FOUND = 101;
  101. /**
  102. * Error code indicating you tried to query with a datatype that doesn't
  103. * support it, like exact matching an array or object.
  104. *
  105. * @property {number} INVALID_QUERY
  106. * @static
  107. */
  108. ParseError.INVALID_QUERY = 102;
  109. /**
  110. * Error code indicating a missing or invalid classname. Classnames are
  111. * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
  112. * only valid characters.
  113. *
  114. * @property {number} INVALID_CLASS_NAME
  115. * @static
  116. */
  117. ParseError.INVALID_CLASS_NAME = 103;
  118. /**
  119. * Error code indicating an unspecified object id.
  120. *
  121. * @property {number} MISSING_OBJECT_ID
  122. * @static
  123. */
  124. ParseError.MISSING_OBJECT_ID = 104;
  125. /**
  126. * Error code indicating an invalid key name. Keys are case-sensitive. They
  127. * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
  128. *
  129. * @property {number} INVALID_KEY_NAME
  130. * @static
  131. */
  132. ParseError.INVALID_KEY_NAME = 105;
  133. /**
  134. * Error code indicating a malformed pointer. You should not see this unless
  135. * you have been mucking about changing internal Parse code.
  136. *
  137. * @property {number} INVALID_POINTER
  138. * @static
  139. */
  140. ParseError.INVALID_POINTER = 106;
  141. /**
  142. * Error code indicating that badly formed JSON was received upstream. This
  143. * either indicates you have done something unusual with modifying how
  144. * things encode to JSON, or the network is failing badly.
  145. *
  146. * @property {number} INVALID_JSON
  147. * @static
  148. */
  149. ParseError.INVALID_JSON = 107;
  150. /**
  151. * Error code indicating that the feature you tried to access is only
  152. * available internally for testing purposes.
  153. *
  154. * @property {number} COMMAND_UNAVAILABLE
  155. * @static
  156. */
  157. ParseError.COMMAND_UNAVAILABLE = 108;
  158. /**
  159. * You must call Parse.initialize before using the Parse library.
  160. *
  161. * @property {number} NOT_INITIALIZED
  162. * @static
  163. */
  164. ParseError.NOT_INITIALIZED = 109;
  165. /**
  166. * Error code indicating that a field was set to an inconsistent type.
  167. *
  168. * @property {number} INCORRECT_TYPE
  169. * @static
  170. */
  171. ParseError.INCORRECT_TYPE = 111;
  172. /**
  173. * Error code indicating an invalid channel name. A channel name is either
  174. * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
  175. * characters and starts with a letter.
  176. *
  177. * @property {number} INVALID_CHANNEL_NAME
  178. * @static
  179. */
  180. ParseError.INVALID_CHANNEL_NAME = 112;
  181. /**
  182. * Error code indicating that push is misconfigured.
  183. *
  184. * @property {number} PUSH_MISCONFIGURED
  185. * @static
  186. */
  187. ParseError.PUSH_MISCONFIGURED = 115;
  188. /**
  189. * Error code indicating that the object is too large.
  190. *
  191. * @property {number} OBJECT_TOO_LARGE
  192. * @static
  193. */
  194. ParseError.OBJECT_TOO_LARGE = 116;
  195. /**
  196. * Error code indicating that the operation isn't allowed for clients.
  197. *
  198. * @property {number} OPERATION_FORBIDDEN
  199. * @static
  200. */
  201. ParseError.OPERATION_FORBIDDEN = 119;
  202. /**
  203. * Error code indicating the result was not found in the cache.
  204. *
  205. * @property {number} CACHE_MISS
  206. * @static
  207. */
  208. ParseError.CACHE_MISS = 120;
  209. /**
  210. * Error code indicating that an invalid key was used in a nested
  211. * JSONObject.
  212. *
  213. * @property {number} INVALID_NESTED_KEY
  214. * @static
  215. */
  216. ParseError.INVALID_NESTED_KEY = 121;
  217. /**
  218. * Error code indicating that an invalid filename was used for ParseFile.
  219. * A valid file name contains only a-zA-Z0-9_. characters and is between 1
  220. * and 128 characters.
  221. *
  222. * @property {number} INVALID_FILE_NAME
  223. * @static
  224. */
  225. ParseError.INVALID_FILE_NAME = 122;
  226. /**
  227. * Error code indicating an invalid ACL was provided.
  228. *
  229. * @property {number} INVALID_ACL
  230. * @static
  231. */
  232. ParseError.INVALID_ACL = 123;
  233. /**
  234. * Error code indicating that the request timed out on the server. Typically
  235. * this indicates that the request is too expensive to run.
  236. *
  237. * @property {number} TIMEOUT
  238. * @static
  239. */
  240. ParseError.TIMEOUT = 124;
  241. /**
  242. * Error code indicating that the email address was invalid.
  243. *
  244. * @property {number} INVALID_EMAIL_ADDRESS
  245. * @static
  246. */
  247. ParseError.INVALID_EMAIL_ADDRESS = 125;
  248. /**
  249. * Error code indicating a missing content type.
  250. *
  251. * @property {number} MISSING_CONTENT_TYPE
  252. * @static
  253. */
  254. ParseError.MISSING_CONTENT_TYPE = 126;
  255. /**
  256. * Error code indicating a missing content length.
  257. *
  258. * @property {number} MISSING_CONTENT_LENGTH
  259. * @static
  260. */
  261. ParseError.MISSING_CONTENT_LENGTH = 127;
  262. /**
  263. * Error code indicating an invalid content length.
  264. *
  265. * @property {number} INVALID_CONTENT_LENGTH
  266. * @static
  267. */
  268. ParseError.INVALID_CONTENT_LENGTH = 128;
  269. /**
  270. * Error code indicating a file that was too large.
  271. *
  272. * @property {number} FILE_TOO_LARGE
  273. * @static
  274. */
  275. ParseError.FILE_TOO_LARGE = 129;
  276. /**
  277. * Error code indicating an error saving a file.
  278. *
  279. * @property {number} FILE_SAVE_ERROR
  280. * @static
  281. */
  282. ParseError.FILE_SAVE_ERROR = 130;
  283. /**
  284. * Error code indicating that a unique field was given a value that is
  285. * already taken.
  286. *
  287. * @property {number} DUPLICATE_VALUE
  288. * @static
  289. */
  290. ParseError.DUPLICATE_VALUE = 137;
  291. /**
  292. * Error code indicating that a role's name is invalid.
  293. *
  294. * @property {number} INVALID_ROLE_NAME
  295. * @static
  296. */
  297. ParseError.INVALID_ROLE_NAME = 139;
  298. /**
  299. * Error code indicating that an application quota was exceeded. Upgrade to
  300. * resolve.
  301. *
  302. * @property {number} EXCEEDED_QUOTA
  303. * @static
  304. */
  305. ParseError.EXCEEDED_QUOTA = 140;
  306. /**
  307. * Error code indicating that a Cloud Code script failed.
  308. *
  309. * @property {number} SCRIPT_FAILED
  310. * @static
  311. */
  312. ParseError.SCRIPT_FAILED = 141;
  313. /**
  314. * Error code indicating that a Cloud Code validation failed.
  315. *
  316. * @property {number} VALIDATION_ERROR
  317. * @static
  318. */
  319. ParseError.VALIDATION_ERROR = 142;
  320. /**
  321. * Error code indicating that invalid image data was provided.
  322. *
  323. * @property {number} INVALID_IMAGE_DATA
  324. * @static
  325. */
  326. ParseError.INVALID_IMAGE_DATA = 143;
  327. /**
  328. * Error code indicating an unsaved file.
  329. *
  330. * @property {number} UNSAVED_FILE_ERROR
  331. * @static
  332. */
  333. ParseError.UNSAVED_FILE_ERROR = 151;
  334. /**
  335. * Error code indicating an invalid push time.
  336. *
  337. * @property {number} INVALID_PUSH_TIME_ERROR
  338. * @static
  339. */
  340. ParseError.INVALID_PUSH_TIME_ERROR = 152;
  341. /**
  342. * Error code indicating an error deleting a file.
  343. *
  344. * @property {number} FILE_DELETE_ERROR
  345. * @static
  346. */
  347. ParseError.FILE_DELETE_ERROR = 153;
  348. /**
  349. * Error code indicating an error deleting an unnamed file.
  350. *
  351. * @property {number} FILE_DELETE_UNNAMED_ERROR
  352. * @static
  353. */
  354. ParseError.FILE_DELETE_UNNAMED_ERROR = 161;
  355. /**
  356. * Error code indicating that the application has exceeded its request
  357. * limit.
  358. *
  359. * @property {number} REQUEST_LIMIT_EXCEEDED
  360. * @static
  361. */
  362. ParseError.REQUEST_LIMIT_EXCEEDED = 155;
  363. /**
  364. * Error code indicating that the request was a duplicate and has been discarded due to
  365. * idempotency rules.
  366. *
  367. * @property {number} DUPLICATE_REQUEST
  368. * @static
  369. */
  370. ParseError.DUPLICATE_REQUEST = 159;
  371. /**
  372. * Error code indicating an invalid event name.
  373. *
  374. * @property {number} INVALID_EVENT_NAME
  375. * @static
  376. */
  377. ParseError.INVALID_EVENT_NAME = 160;
  378. /**
  379. * Error code indicating that a field had an invalid value.
  380. *
  381. * @property {number} INVALID_VALUE
  382. * @static
  383. */
  384. ParseError.INVALID_VALUE = 162;
  385. /**
  386. * Error code indicating that the username is missing or empty.
  387. *
  388. * @property {number} USERNAME_MISSING
  389. * @static
  390. */
  391. ParseError.USERNAME_MISSING = 200;
  392. /**
  393. * Error code indicating that the password is missing or empty.
  394. *
  395. * @property {number} PASSWORD_MISSING
  396. * @static
  397. */
  398. ParseError.PASSWORD_MISSING = 201;
  399. /**
  400. * Error code indicating that the username has already been taken.
  401. *
  402. * @property {number} USERNAME_TAKEN
  403. * @static
  404. */
  405. ParseError.USERNAME_TAKEN = 202;
  406. /**
  407. * Error code indicating that the email has already been taken.
  408. *
  409. * @property {number} EMAIL_TAKEN
  410. * @static
  411. */
  412. ParseError.EMAIL_TAKEN = 203;
  413. /**
  414. * Error code indicating that the email is missing, but must be specified.
  415. *
  416. * @property {number} EMAIL_MISSING
  417. * @static
  418. */
  419. ParseError.EMAIL_MISSING = 204;
  420. /**
  421. * Error code indicating that a user with the specified email was not found.
  422. *
  423. * @property {number} EMAIL_NOT_FOUND
  424. * @static
  425. */
  426. ParseError.EMAIL_NOT_FOUND = 205;
  427. /**
  428. * Error code indicating that a user object without a valid session could
  429. * not be altered.
  430. *
  431. * @property {number} SESSION_MISSING
  432. * @static
  433. */
  434. ParseError.SESSION_MISSING = 206;
  435. /**
  436. * Error code indicating that a user can only be created through signup.
  437. *
  438. * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP
  439. * @static
  440. */
  441. ParseError.MUST_CREATE_USER_THROUGH_SIGNUP = 207;
  442. /**
  443. * Error code indicating that an an account being linked is already linked
  444. * to another user.
  445. *
  446. * @property {number} ACCOUNT_ALREADY_LINKED
  447. * @static
  448. */
  449. ParseError.ACCOUNT_ALREADY_LINKED = 208;
  450. /**
  451. * Error code indicating that the current session token is invalid.
  452. *
  453. * @property {number} INVALID_SESSION_TOKEN
  454. * @static
  455. */
  456. ParseError.INVALID_SESSION_TOKEN = 209;
  457. /**
  458. * Error code indicating an error enabling or verifying MFA
  459. *
  460. * @property {number} MFA_ERROR
  461. * @static
  462. */
  463. ParseError.MFA_ERROR = 210;
  464. /**
  465. * Error code indicating that a valid MFA token must be provided
  466. *
  467. * @property {number} MFA_TOKEN_REQUIRED
  468. * @static
  469. */
  470. ParseError.MFA_TOKEN_REQUIRED = 211;
  471. /**
  472. * Error code indicating that a user cannot be linked to an account because
  473. * that account's id could not be found.
  474. *
  475. * @property {number} LINKED_ID_MISSING
  476. * @static
  477. */
  478. ParseError.LINKED_ID_MISSING = 250;
  479. /**
  480. * Error code indicating that a user with a linked (e.g. Facebook) account
  481. * has an invalid session.
  482. *
  483. * @property {number} INVALID_LINKED_SESSION
  484. * @static
  485. */
  486. ParseError.INVALID_LINKED_SESSION = 251;
  487. /**
  488. * Error code indicating that a service being linked (e.g. Facebook or
  489. * Twitter) is unsupported.
  490. *
  491. * @property {number} UNSUPPORTED_SERVICE
  492. * @static
  493. */
  494. ParseError.UNSUPPORTED_SERVICE = 252;
  495. /**
  496. * Error code indicating an invalid operation occured on schema
  497. *
  498. * @property {number} INVALID_SCHEMA_OPERATION
  499. * @static
  500. */
  501. ParseError.INVALID_SCHEMA_OPERATION = 255;
  502. /**
  503. * Error code indicating that there were multiple errors. Aggregate errors
  504. * have an "errors" property, which is an array of error objects with more
  505. * detail about each error that occurred.
  506. *
  507. * @property {number} AGGREGATE_ERROR
  508. * @static
  509. */
  510. ParseError.AGGREGATE_ERROR = 600;
  511. /**
  512. * Error code indicating the client was unable to read an input file.
  513. *
  514. * @property {number} FILE_READ_ERROR
  515. * @static
  516. */
  517. ParseError.FILE_READ_ERROR = 601;
  518. /**
  519. * Error code indicating a real error code is unavailable because
  520. * we had to use an XDomainRequest object to allow CORS requests in
  521. * Internet Explorer, which strips the body from HTTP responses that have
  522. * a non-2XX status code.
  523. *
  524. * @property {number} X_DOMAIN_REQUEST
  525. * @static
  526. */
  527. ParseError.X_DOMAIN_REQUEST = 602;
  528. var _default = ParseError;
  529. exports.default = _default;