-
Notifications
You must be signed in to change notification settings - Fork 60
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
Change relay-related errors to throw client-side errors #1281
Conversation
export class InvalidMultiSendError extends Error { | ||
import { HttpException, HttpStatus } from '@nestjs/common'; | ||
|
||
export class InvalidMultiSendError extends HttpException { |
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.
Since the status is known, maybe we can extend UnprocessableEntityException
. No strong opinion here though.
(same for the others but with their respective exceptions classes).
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 wasn't aware of that! I changed it in 6e5c04c. There doesn't seem to be one for 429
though.
Pull Request Test Coverage Report for Build 8236133889Details
💛 - Coveralls |
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.
🚀
Summary
This changes the relay-specific errors from extending
Error
s toHttpException
/UnprocessableEntityException
s in order to specify astatus
. By specifying thestatus
, theRouteLoggerInteceptor
can extract it.Changes
The following exceptions have been changed to extend
HttpException
s with aHttpStatus
orUnprocessableEntityException
accordingly:InvalidMultiSendError
InvalidTransferError
RelayLimitReachedError
UnofficialMasterCopyError
UnofficialMultiSendError
UnofficialProxyFactoryError