FIRFirestoreErrors.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /** The Cloud Firestore error domain. */
  19. FOUNDATION_EXPORT NSString *const FIRFirestoreErrorDomain NS_SWIFT_NAME(FirestoreErrorDomain);
  20. /** Error codes used by Cloud Firestore. */
  21. typedef NS_ERROR_ENUM(FIRFirestoreErrorDomain, FIRFirestoreErrorCode){
  22. /**
  23. * The operation completed successfully. `NSError` objects will never have a code with this
  24. * value.
  25. */
  26. FIRFirestoreErrorCodeOK = 0,
  27. /** The operation was cancelled (typically by the caller). */
  28. FIRFirestoreErrorCodeCancelled = 1,
  29. /** Unknown error or an error from a different error domain. */
  30. FIRFirestoreErrorCodeUnknown = 2,
  31. /**
  32. * Client specified an invalid argument. Note that this differs from FailedPrecondition.
  33. * InvalidArgument indicates arguments that are problematic regardless of the state of the
  34. * system (e.g., an invalid field name).
  35. */
  36. FIRFirestoreErrorCodeInvalidArgument = 3,
  37. /**
  38. * Deadline expired before operation could complete. For operations that change the state of the
  39. * system, this error may be returned even if the operation has completed successfully. For
  40. * example, a successful response from a server could have been delayed long enough for the
  41. * deadline to expire.
  42. */
  43. FIRFirestoreErrorCodeDeadlineExceeded = 4,
  44. /** Some requested document was not found. */
  45. FIRFirestoreErrorCodeNotFound = 5,
  46. /** Some document that we attempted to create already exists. */
  47. FIRFirestoreErrorCodeAlreadyExists = 6,
  48. /** The caller does not have permission to execute the specified operation. */
  49. FIRFirestoreErrorCodePermissionDenied = 7,
  50. /**
  51. * Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system
  52. * is out of space.
  53. */
  54. FIRFirestoreErrorCodeResourceExhausted = 8,
  55. /**
  56. * Operation was rejected because the system is not in a state required for the operation's
  57. * execution.
  58. */
  59. FIRFirestoreErrorCodeFailedPrecondition = 9,
  60. /**
  61. * The operation was aborted, typically due to a concurrency issue like transaction aborts, etc.
  62. */
  63. FIRFirestoreErrorCodeAborted = 10,
  64. /** Operation was attempted past the valid range. */
  65. FIRFirestoreErrorCodeOutOfRange = 11,
  66. /** Operation is not implemented or not supported/enabled. */
  67. FIRFirestoreErrorCodeUnimplemented = 12,
  68. /**
  69. * Internal errors. Means some invariants expected by underlying system has been broken. If you
  70. * see one of these errors, something is very broken.
  71. */
  72. FIRFirestoreErrorCodeInternal = 13,
  73. /**
  74. * The service is currently unavailable. This is a most likely a transient condition and may be
  75. * corrected by retrying with a backoff.
  76. */
  77. FIRFirestoreErrorCodeUnavailable = 14,
  78. /** Unrecoverable data loss or corruption. */
  79. FIRFirestoreErrorCodeDataLoss = 15,
  80. /** The request does not have valid authentication credentials for the operation. */
  81. FIRFirestoreErrorCodeUnauthenticated = 16} NS_SWIFT_NAME(FirestoreErrorCode);
  82. NS_ASSUME_NONNULL_END