-
Notifications
You must be signed in to change notification settings - Fork 18
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
Better exceptions #15
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 309 321 +12
=========================================
+ Hits 309 321 +12
Continue to review full report at Codecov.
|
"""Unknown error code returned from server""" | ||
|
||
|
||
@functools.lru_cache() |
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.
default max_size is 128. Do we want to set it as None to max?
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.
From docs:
If maxsize is set to None, the LRU feature is disabled and the cache can grow without bound.
I think LRU cache is useful here, as in many cases it will work like so:
Exception is generated and raised, and in exception handlers, users also catch that exception, so exception is returned from cache, as it is was used recently.
If we disable LRU, doesn't the cache grow indefinitely?
I don't think more than 128 exceptions limit will ever be reached anyway.
bitcart/bitcart#115
TODO before merging: remove checking out from better-exceptions branch