ParseError.js 14 KB

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