mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Updated the config message generation for GRDB Migrated more preferences into GRDB Added paging to the MediaTileViewController and sorted out the various animations/transitions Fixed an issue where the 'recipientState' for the 'baseQuery' on the ConversationCell.ViewModel wasn't grouping correctly Fixed an issue where the MediaZoomAnimationController could fail if the contextual info wasn't available Fixed an issue where the MediaZoomAnimationController bounce looked odd when returning to the detail screen from the tile screen Fixed an issue where the MediaZoomAnimationController didn't work for videos Fixed a bug where the YDB to GRDB migration wasn't properly handling video files Fixed a number of minor UI bugs with the GalleryRailView Deleted a bunch of legacy code
68 lines
2.7 KiB
Objective-C
68 lines
2.7 KiB
Objective-C
//
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
#import "OWSError.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
NSString *const OWSSignalServiceKitErrorDomain = @"OWSSignalServiceKitErrorDomain";
|
|
NSString *const OWSErrorRecipientIdentifierKey = @"OWSErrorKeyRecipientIdentifier";
|
|
|
|
NSError *OWSErrorWithCodeDescription(OWSErrorCode code, NSString *description)
|
|
{
|
|
return [NSError errorWithDomain:OWSSignalServiceKitErrorDomain
|
|
code:code
|
|
userInfo:@{ NSLocalizedDescriptionKey: description }];
|
|
}
|
|
|
|
NSError *OWSErrorMakeUnableToProcessServerResponseError()
|
|
{
|
|
return OWSErrorWithCodeDescription(OWSErrorCodeUnableToProcessServerResponse,
|
|
NSLocalizedString(@"ERROR_DESCRIPTION_SERVER_FAILURE", @"Generic server error"));
|
|
}
|
|
|
|
NSError *OWSErrorMakeFailedToSendOutgoingMessageError()
|
|
{
|
|
return OWSErrorWithCodeDescription(OWSErrorCodeFailedToSendOutgoingMessage,
|
|
NSLocalizedString(@"ERROR_DESCRIPTION_CLIENT_SENDING_FAILURE", @"Generic notice when message failed to send."));
|
|
}
|
|
|
|
NSError *OWSErrorMakeAssertionError(NSString *description)
|
|
{
|
|
OWSCFailDebug(@"Assertion failed: %@", description);
|
|
return OWSErrorWithCodeDescription(OWSErrorCodeAssertionFailure,
|
|
NSLocalizedString(@"ERROR_DESCRIPTION_UNKNOWN_ERROR", @"Worst case generic error message"));
|
|
}
|
|
|
|
NSError *OWSErrorMakeUntrustedIdentityError(NSString *description, NSString *recipientId)
|
|
{
|
|
return [NSError
|
|
errorWithDomain:OWSSignalServiceKitErrorDomain
|
|
code:OWSErrorCodeUntrustedIdentity
|
|
userInfo:@{ NSLocalizedDescriptionKey : description, OWSErrorRecipientIdentifierKey : recipientId }];
|
|
}
|
|
|
|
NSError *OWSErrorMakeMessageSendDisabledDueToPreKeyUpdateFailuresError()
|
|
{
|
|
return OWSErrorWithCodeDescription(OWSErrorCodeMessageSendDisabledDueToPreKeyUpdateFailures,
|
|
NSLocalizedString(@"ERROR_DESCRIPTION_MESSAGE_SEND_DISABLED_PREKEY_UPDATE_FAILURES",
|
|
@"Error message indicating that message send is disabled due to prekey update failures"));
|
|
}
|
|
|
|
NSError *OWSErrorMakeMessageSendFailedDueToBlockListError()
|
|
{
|
|
return OWSErrorWithCodeDescription(OWSErrorCodeMessageSendFailedToBlockList,
|
|
NSLocalizedString(@"ERROR_DESCRIPTION_MESSAGE_SEND_FAILED_DUE_TO_BLOCK_LIST",
|
|
@"Error message indicating that message send failed due to block list"));
|
|
}
|
|
|
|
NSError *OWSErrorMakeWriteAttachmentDataError()
|
|
{
|
|
return OWSErrorWithCodeDescription(OWSErrorCodeCouldNotWriteAttachmentData,
|
|
NSLocalizedString(@"ERROR_DESCRIPTION_MESSAGE_SEND_FAILED_DUE_TO_FAILED_ATTACHMENT_WRITE",
|
|
@"Error message indicating that message send failed due to failed attachment write"));
|
|
}
|
|
|
|
NS_ASSUME_NONNULL_END
|