Skip to content

Commit

Permalink
better ex message
Browse files Browse the repository at this point in the history
  • Loading branch information
jarektkaczyk committed Jul 21, 2018
1 parent b162a8a commit 92551a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Fsm.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function getCurrentState() : string
public function process(string $action) : string
{
if (!$this->isActionValid($action)) {
throw new InvalidActionException('Provided action is not available in current state');
throw new InvalidActionException(
'Provided action [' . $action . '] is not available in current state [' . $this->state . ']'
);
}

$transition = $this->transitions[$this->state][$action];
Expand Down

0 comments on commit 92551a7

Please sign in to comment.