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

Question: can we extend the role guard and throw forbidden with custom error message? #147

Open
s4kh opened this issue Mar 6, 2023 · 2 comments

Comments

@s4kh
Copy link

s4kh commented Mar 6, 2023

Is there a way to extend roleguard or configure @roles decorator with customer forbidden error message?

@JoaoMarcos160
Copy link

Or also, how to configure an exception filter to capture the ForbiddenException and handle it, or catch a custom exception, what would be the type of this exception?

@ferrerojosh
Copy link
Owner

You could create an exception filter, its covered in NestJS docs: https://docs.nestjs.com/exception-filters#exception-filters-1

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

No branches or pull requests

3 participants