Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Add custom message to thrown exception #28335

Merged
merged 2 commits into from
Apr 26, 2019
Merged

Conversation

fedorovvldmr
Copy link
Contributor

TokenMismatchException throwed without message and stack trace was with empty message

@fedorovvldmr fedorovvldmr changed the title Add custom message to thrown exception [5.8] Add custom message to thrown exception Apr 25, 2019
@@ -79,7 +79,7 @@ public function handle($request, Closure $next)
});
}

throw new TokenMismatchException;
throw new TokenMismatchException('Tokens mismatch');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new TokenMismatchException('Tokens mismatch');
throw new TokenMismatchException('Your CSRF token is mismatching, please refresh the page.');

@taylorotwell
Copy link
Member

The exception name is the message. There was a token mismatch.

@fedorovvldmr
Copy link
Contributor Author

@taylorotwell
There is my tracelog for this exception. There is no name for this exception.

@taylorotwell taylorotwell reopened this Apr 26, 2019
@taylorotwell taylorotwell merged commit 12cf3f4 into laravel:5.8 Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants