Skip to content

[5.8] Add custom message to thrown exception - #28335

Merged
taylorotwell merged 2 commits into
laravel:5.8from
fedorovvldmr:5.8
Apr 26, 2019
Merged

[5.8] Add custom message to thrown exception#28335
taylorotwell merged 2 commits into
laravel:5.8from
fedorovvldmr:5.8

Conversation

@fedorovvldmr

Copy link
Copy Markdown
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
}

throw new TokenMismatchException;
throw new TokenMismatchException('Tokens mismatch');

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@fedorovvldmr

Copy link
Copy Markdown
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