summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLError.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/SDLError.m')
-rw-r--r--SmartDeviceLink/SDLError.m64
1 files changed, 32 insertions, 32 deletions
diff --git a/SmartDeviceLink/SDLError.m b/SmartDeviceLink/SDLError.m
index 21f64c79c..d561feab4 100644
--- a/SmartDeviceLink/SDLError.m
+++ b/SmartDeviceLink/SDLError.m
@@ -21,10 +21,10 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
+ (NSError *)sdl_lifecycle_rpcErrorWithDescription:(NSString *)description andReason:(NSString *)reason {
NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(description, nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(reason, nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
+ NSLocalizedDescriptionKey : NSLocalizedString(description, nil),
+ NSLocalizedFailureReasonErrorKey : NSLocalizedString(reason, nil),
+ NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorRPCRequestFailed
userInfo:userInfo];
@@ -32,11 +32,11 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
+ (NSError *)sdl_lifecycle_notConnectedError {
NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"Could not find a connection", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The SDL library could not find a current connection to an SDL hardware device", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
-
+ NSLocalizedDescriptionKey : NSLocalizedString(@"Could not find a connection", nil),
+ NSLocalizedFailureReasonErrorKey : NSLocalizedString(@"The SDL library could not find a current connection to an SDL hardware device", nil),
+ NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
+
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorNotConnected
userInfo:userInfo];
@@ -44,11 +44,11 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
+ (NSError *)sdl_lifecycle_notReadyError {
NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"Lifecycle manager not ready", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The SDL library is not finished setting up the connection, please wait until the lifecycleState is SDLLifecycleStateReady", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
-
+ NSLocalizedDescriptionKey : NSLocalizedString(@"Lifecycle manager not ready", nil),
+ NSLocalizedFailureReasonErrorKey : NSLocalizedString(@"The SDL library is not finished setting up the connection, please wait until the lifecycleState is SDLLifecycleStateReady", nil),
+ NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
+
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorNotConnected
userInfo:userInfo];
@@ -56,10 +56,10 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
+ (NSError *)sdl_lifecycle_unknownRemoteErrorWithDescription:(NSString *)description andReason:(NSString *)reason {
NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(description, nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(reason, nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
+ NSLocalizedDescriptionKey : NSLocalizedString(description, nil),
+ NSLocalizedFailureReasonErrorKey : NSLocalizedString(reason, nil),
+ NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorUnknownRemoteError
userInfo:userInfo];
@@ -70,19 +70,19 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
+ (NSError *)sdl_fileManager_cannotOverwriteError {
NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"Cannot overwrite remote file", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The remote file system already has a file of this name, and the file manager is set to not automatically overwrite files", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Set SDLFileManager autoOverwrite to YES, or call forceUploadFile:completion:", nil)
- };
+ NSLocalizedDescriptionKey : NSLocalizedString(@"Cannot overwrite remote file", nil),
+ NSLocalizedFailureReasonErrorKey : NSLocalizedString(@"The remote file system already has a file of this name, and the file manager is set to not automatically overwrite files", nil),
+ NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Set SDLFileManager autoOverwrite to YES, or call forceUploadFile:completion:", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorCannotOverwrite userInfo:userInfo];
}
+ (NSError *)sdl_fileManager_noKnownFileError {
NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"No such remote file is currently known", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The remote file is not currently known by the file manager. It could be that this file does not exist on the remote system or that the file manager has not completed its initialization and received a list of files from the remote system.", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure a file with this name is present on the remote system and that the file manager has finished its initialization.", nil)
- };
+ NSLocalizedDescriptionKey : NSLocalizedString(@"No such remote file is currently known", nil),
+ NSLocalizedFailureReasonErrorKey : NSLocalizedString(@"The remote file is not currently known by the file manager. It could be that this file does not exist on the remote system or that the file manager has not completed its initialization and received a list of files from the remote system.", nil),
+ NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Make sure a file with this name is present on the remote system and that the file manager has finished its initialization.", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorNoKnownFile userInfo:userInfo];
}
@@ -93,16 +93,16 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
+ (NSException *)sdl_missingHandlerException {
return [NSException
- exceptionWithName:@"MissingHandlerException"
- reason:@"This request requires a handler to be specified using the <RPC>WithHandler class"
- userInfo:nil];
+ exceptionWithName:@"MissingHandlerException"
+ reason:@"This request requires a handler to be specified using the <RPC>WithHandler class"
+ userInfo:nil];
}
+ (NSException *)sdl_missingIdException {
return [NSException
- exceptionWithName:@"MissingIdException"
- reason:@"This request requires an ID (command, softbutton, etc) to be specified"
- userInfo:nil];
+ exceptionWithName:@"MissingIdException"
+ reason:@"This request requires an ID (command, softbutton, etc) to be specified"
+ userInfo:nil];
}
@end