ParseError.js 12 KB

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