session-ios/SignalUtilitiesKit/Utilities/OWSError.h

72 lines
3.1 KiB
Objective-C

//
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern NSString *const OWSSignalServiceKitErrorDomain;
typedef NS_ENUM(NSInteger, OWSErrorCode) {
OWSErrorCodeInvalidMethodParameters = 11,
OWSErrorCodeUnableToProcessServerResponse = 12,
OWSErrorCodeFailedToDecodeJson = 13,
OWSErrorCodeFailedToEncodeJson = 14,
OWSErrorCodeFailedToDecodeQR = 15,
OWSErrorCodePrivacyVerificationFailure = 20,
OWSErrorCodeUntrustedIdentity = 25,
OWSErrorCodeFailedToSendOutgoingMessage = 30,
OWSErrorCodeAssertionFailure = 31,
OWSErrorCodeFailedToDecryptMessage = 100,
OWSErrorCodeFailedToDecryptUDMessage = 101,
OWSErrorCodeFailedToEncryptMessage = 110,
OWSErrorCodeFailedToEncryptUDMessage = 111,
OWSErrorCodeSignalServiceFailure = 1001,
OWSErrorCodeSignalServiceRateLimited = 1010,
OWSErrorCodeUserError = 2001,
OWSErrorCodeNoSuchSignalRecipient = 777404,
OWSErrorCodeMessageSendDisabledDueToPreKeyUpdateFailures = 777405,
OWSErrorCodeMessageSendFailedToBlockList = 777406,
OWSErrorCodeMessageSendNoValidRecipients = 777407,
OWSErrorCodeContactsUpdaterRateLimit = 777408,
OWSErrorCodeCouldNotWriteAttachmentData = 777409,
OWSErrorCodeMessageDeletedBeforeSent = 777410,
OWSErrorCodeDatabaseConversionFatalError = 777411,
OWSErrorCodeMoveFileToSharedDataContainerError = 777412,
OWSErrorCodeRegistrationMissing2FAPIN = 777413,
OWSErrorCodeDebugLogUploadFailed = 777414,
// A non-recoverable error occured while exporting a backup.
OWSErrorCodeExportBackupFailed = 777415,
// A possibly recoverable error occured while exporting a backup.
OWSErrorCodeExportBackupError = 777416,
// A non-recoverable error occured while importing a backup.
OWSErrorCodeImportBackupFailed = 777417,
// A possibly recoverable error occured while importing a backup.
OWSErrorCodeImportBackupError = 777418,
// A non-recoverable while importing or exporting a backup.
OWSErrorCodeBackupFailure = 777419,
OWSErrorCodeLocalAuthenticationError = 777420,
OWSErrorCodeMessageRequestFailed = 777421,
OWSErrorCodeMessageResponseFailed = 777422,
OWSErrorCodeInvalidMessage = 777423,
OWSErrorCodeProfileUpdateFailed = 777424,
OWSErrorCodeAvatarWriteFailed = 777425,
OWSErrorCodeAvatarUploadFailed = 777426,
OWSErrorCodeNoSessionForTransientMessage,
};
extern NSString *const OWSErrorRecipientIdentifierKey;
extern NSError *OWSErrorWithCodeDescription(OWSErrorCode code, NSString *description);
extern NSError *OWSErrorMakeUntrustedIdentityError(NSString *description, NSString *recipientId);
extern NSError *OWSErrorMakeUnableToProcessServerResponseError(void);
extern NSError *OWSErrorMakeFailedToSendOutgoingMessageError(void);
extern NSError *OWSErrorMakeNoSuchSignalRecipientError(void);
extern NSError *OWSErrorMakeAssertionError(NSString *description);
extern NSError *OWSErrorMakeMessageSendDisabledDueToPreKeyUpdateFailuresError(void);
extern NSError *OWSErrorMakeMessageSendFailedDueToBlockListError(void);
extern NSError *OWSErrorMakeWriteAttachmentDataError(void);
NS_ASSUME_NONNULL_END