-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding EntityGoneError #133
Conversation
@@ -54,6 +54,17 @@ export class EntityNotFoundError extends PublicNonRecoverableError { | |||
} | |||
} | |||
|
|||
export class EntityGoneError extends PublicNonRecoverableError { |
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.
do we ever need to instanceof check it? wonder if we need a flag on it, and a typeguard
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.
Good point, yeah, we would need the instanceof
in some cases
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.
typeguard added, not sure what do you mean by the flag, but please have a look to see if it makes sense 🙏
Note: all 410 http errors considered as entityGone, no matter if it was created as a PublincNonRecoverableError
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.
common technique for simple typeguards is adding a field like "isEntityGone: true" so that you could do a single-field check, but you are right, in this case http code check is a better option!
Changes
Adding entity gone error, useful to send back that the entity does no longer exists
Checklist
major
,minor
,patch
orskip-release