BTHTTPErrors.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #import <Foundation/Foundation.h>
  2. /**
  3. The error domain for BTHTTP errors
  4. */
  5. extern NSString * const BTHTTPErrorDomain;
  6. /**
  7. Key for userInfo dictionary that contains the NSHTTPURLResponse from server when it returns an HTTP error
  8. */
  9. extern NSString * const BTHTTPURLResponseKey;
  10. /**
  11. Key for userInfo dictionary that contains the BTJSON body of the HTTP error response
  12. */
  13. extern NSString * const BTHTTPJSONResponseBodyKey;
  14. /**
  15. BTHTTP error codes
  16. */
  17. typedef NS_ENUM(NSInteger, BTHTTPErrorCode) {
  18. /// Unknown error (reserved)
  19. BTHTTPErrorCodeUnknown = 0,
  20. /// The response had a Content-Type header that is not supported
  21. BTHTTPErrorCodeResponseContentTypeNotAcceptable,
  22. /// The response was a 4xx error, e.g. 422, indicating a problem with the client's request
  23. BTHTTPErrorCodeClientError,
  24. /// The response was a 5xx server error
  25. BTHTTPErrorCodeServerError,
  26. /// The BTHTTP instance was missing a base URL
  27. BTHTTPErrorCodeMissingBaseURL,
  28. /// The response was a 429, indicating a rate limiting error
  29. BTHTTPErrorCodeRateLimitError
  30. };