summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLStateMachine.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/SDLStateMachine.m')
-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..2d197344d 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 *targetClassString = NSStringFromClass([self.target class]);
+ NSString *reasonMessage = [NSString stringWithFormat:@"Invalid state machine %@ transition of target %@ occurred from %@ to %@", NSStringFromClass(self.class), targetClassString, self.currentState, state];
@throw [NSException exceptionWithName:NSInternalInconsistencyException
- reason:@"Invalid state machine transition occurred"
- userInfo:@{SDLStateMachineExceptionInfoKeyTargetClass: NSStringFromClass([self.target class]),
+ reason:reasonMessage
+ userInfo:@{SDLStateMachineExceptionInfoKeyTargetClass: targetClassString,
SDLStateMachineExceptionInfoKeyFromState: self.currentState,
SDLStateMachineExceptionInfoKeyToClass: state}];
}