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

RateLimiterConfig should have default values #4609

Closed
Tanky-Zhang opened this issue Oct 18, 2022 · 3 comments
Closed

RateLimiterConfig should have default values #4609

Tanky-Zhang opened this issue Oct 18, 2022 · 3 comments
Labels
Milestone

Comments

@Tanky-Zhang
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When I use the limiter, I find that if the limiter is not initialized or has been deleted,now "NumberFormatException" occurs if I invoke "limiter.getConfig().getRate()".
example:
image
image

Describe the solution you'd like
After debuging, it was found that there is no nullifying process for map in the source code. I think there should be a better way to handle it, such as giving the default value or throwing an exception where the limiter does not exist, so I modified it and submitted pr.
#4608

@cy
Copy link

cy commented Nov 9, 2022

I'm also running into this issue - maybe instead of throwing or returning a default value it could simply return null?

@Tanky-Zhang
Copy link
Contributor Author

I'm also running into this issue - maybe instead of throwing or returning a default value it could simply return null?

yes,"return null" is also suitable,maybe more suitable,but it seems that maintiners don‘t think this is a problem.

@mrniko
Copy link
Member

mrniko commented Nov 10, 2022

merged

@mrniko mrniko closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants