-
Notifications
You must be signed in to change notification settings - Fork 857
Allow custom LoaderResult errors #928
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
Conversation
|
|
||
| class LoaderResult(object): | ||
|
|
||
| ERROR_NOT_FOUND = 'not_found' |
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.
@gi11es Removing those const would be backward incompatible. For thumbor 6 it should be possible to support both constants and response codes.
elif result.loader_error == LoaderResult.ERROR_TIMEOUT:
# Return a Gateway Timeout status if upstream timed out (i.e. 599)
self._error(504)
elif isinstance(result.loader_error, int):
self._error(result.loader_error)
return
|
Fair enough, I'll update the PR to that effect |
b981c1b to
2a666d0
Compare
2a666d0 to
afb1c0e
Compare
|
@masom your concerns should be addressed now. |
5a1fdd5 to
bcaae99
Compare
Being constrained to the hardcoded list is too limiting. Using the actual codes is also less prone to confusion.
bcaae99 to
30b20d5
Compare
|
Merge pls? :) |
|
Thanks @gi11es for rebasing this. 🚀 |
Being constrained to the hardcoded list is too limiting.
Using the actual codes is also less prone to confusion.