Skip to content

Commit 278243f

Browse files
committed
Improved invalid-state log message
1 parent 34993d4 commit 278243f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Moryx/StateMachines/StateBase.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ protected Task<T> InvalidStateAsync<T>([CallerMemberName] string methodName = ""
6868
/// </summary>
6969
private Exception CreateAndLogInvalidStateException(string methodName)
7070
{
71-
var error = $"The state with the name '{GetType().Name}' cannot handle the method '{methodName}'.";
71+
var error = $"The state with the name '{GetType().Name}' cannot handle the method '{methodName}'. " +
72+
$"Responsible context: '{Context.GetType().Name}'.";
7273

7374
// ReSharper disable once SuspiciousTypeConversion.Global
7475
(Context as ILoggingComponent)?.Logger.Log(LogLevel.Error, error);
@@ -173,4 +174,4 @@ public override string ToString()
173174
/// Shortcut class for the stateMap dictionary
174175
/// </summary>
175176
public sealed class StateMap : Dictionary<int, StateBase>;
176-
}
177+
}

0 commit comments

Comments
 (0)