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

Adding EntityGoneError #133

Merged
merged 5 commits into from
May 16, 2024
Merged

Adding EntityGoneError #133

merged 5 commits into from
May 16, 2024

Conversation

CarlosGamero
Copy link
Contributor

@CarlosGamero CarlosGamero commented May 16, 2024

Changes

Adding entity gone error, useful to send back that the entity does no longer exists

Checklist

  • Apply one of following labels; major, minor, patch or skip-release
  • I've updated the documentation, or no changes were necessary
  • I've updated the tests, or no changes were necessary

@CarlosGamero CarlosGamero self-assigned this May 16, 2024
@CarlosGamero CarlosGamero requested review from kibertoad, drdaemos and a team as code owners May 16, 2024 16:19
@@ -54,6 +54,17 @@ export class EntityNotFoundError extends PublicNonRecoverableError {
}
}

export class EntityGoneError extends PublicNonRecoverableError {
Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Collaborator

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!

@CarlosGamero CarlosGamero merged commit bdd46d4 into main May 16, 2024
5 checks passed
@CarlosGamero CarlosGamero deleted the feat/entity_gone_error branch May 16, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants