-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(guard): add method for overriding throttling message #1388
Conversation
@@ -124,6 +131,6 @@ export class ThrottlerGuard implements CanActivate { | |||
*/ | |||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | |||
protected throwThrottlingException(context: ExecutionContext): void { | |||
throw new ThrottlerException(this.errorMessage); | |||
throw new ThrottlerException(this.throttlingMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message itself isn't private
so any child class can already override it. Any reason to make a method to get it and override it instead of just overriding the message itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would make sense when we are doing i81n stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overriding method is better as oppose overriding the property directly incase there's an extra check/validation before displaying throttling message @jmcdo29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. This shouldn't be breaking, so would you like to add a minor
changeset to the PR for a release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmcdo29 where do I add the minor changeset? CHANGELOG?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run yarn changeset
and follow the wizard
Added to #1565 |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information