summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-02-22 13:16:14 +0100
committerMuller, Alexander (A.) <amulle19@ford.com>2017-02-22 13:16:14 +0100
commitf731341d23037f288dd69d7582ec597099d20be7 (patch)
treecabdf00ad601b622ea2efe702e3cfaea66480c6d
parenta284bdfc1e92ef7e5048fb8d5b1364885bd6ee01 (diff)
downloadsdl_ios-f731341d23037f288dd69d7582ec597099d20be7.tar.gz
Added in more descriptive exception throw for debugging.hotfix/issue_543
-rw-r--r--SmartDeviceLink/SDLStateMachine.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLStateMachine.m b/SmartDeviceLink/SDLStateMachine.m
index ab5c54689..2bd14a853 100644
--- a/SmartDeviceLink/SDLStateMachine.m
+++ b/SmartDeviceLink/SDLStateMachine.m
@@ -62,9 +62,11 @@ SDLStateMachineTransitionFormat const SDLStateMachineTransitionFormatDidEnter =
}
if (![self sdl_canState:self.currentState transitionToState:state]) {
+ NSString *classString = NSStringFromClass([self.target class]);
+ NSString *reasonMessage = [NSString stringWithFormat:@"Invalid state machine transition of %@ occurred from %@ to %@", classString, self.currentState, state];
@throw [NSException exceptionWithName:NSInternalInconsistencyException
- reason:@"Invalid state machine transition occurred"
- userInfo:@{SDLStateMachineExceptionInfoKeyTargetClass: NSStringFromClass([self.target class]),
+ reason:reasonMessage
+ userInfo:@{SDLStateMachineExceptionInfoKeyTargetClass: classString,
SDLStateMachineExceptionInfoKeyFromState: self.currentState,
SDLStateMachineExceptionInfoKeyToClass: state}];
}