DBRequestHttpError

Objective-C

@interface DBRequestHttpError : NSObject

Swift

class DBRequestHttpError : NSObject

Http request error.

Contains relevant information regarding a failed network request. All error types except for DBClientError extend this class as children. Initialized in the event of a generic, unidentified HTTP error.

  • The Dropbox request id of the network call. This is useful to Dropbox for debugging issues with Dropbox’s SDKs and API. Please include the value of this field when submitting technical support inquiries to Dropbox.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull requestId;

    Swift

    var requestId: String { get }
  • The HTTP response status code of the request.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull statusCode;

    Swift

    var statusCode: NSNumber { get }
  • A string representation of the error body received in the reponse. If for a route-specific error, this field will be the value of the “error_summary” key.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull errorContent;

    Swift

    var errorContent: String { get }
  • An object containing a localized human-readable error message that is optionally returned from some API endpoints.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) DBLocalizedUserMessage *userMessage;

    Swift

    var userMessage: DBLocalizedUserMessage? { get }
  • DBRequestHttpError full constructor.

    Declaration

    Objective-C

    - (nonnull instancetype)init:(nonnull NSString *)requestId
                      statusCode:(nonnull NSNumber *)statusCode
                    errorContent:(nonnull NSString *)errorContent
                     userMessage:(nullable DBLocalizedUserMessage *)userMessage;

    Swift

    init(_ requestId: String, statusCode: NSNumber, errorContent: String, userMessage: DBLocalizedUserMessage?)

    Parameters

    requestId

    The Dropbox request id of the network call. This is useful to Dropbox for debugging issues with Dropbox’s SDKs and API.

    statusCode

    The HTTP response status code of the request.

    errorContent

    A string representation of the error body received in the reponse. If for a route-specific error, this field will be the value of the “error_summary” key.

    userMessage

    An error message object that is optionally returned from some API endpoints.

    Return Value

    An initialized DBRequestHttpError instance.

  • Description method.

    Declaration

    Objective-C

    - (nonnull NSString *)description;

    Swift

    func description() -> String

    Return Value

    A human-readable representation of the current DBRequestHttpError object.