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

feat: application error support #286

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Conversation

stephancill
Copy link
Contributor

Change Summary

Adds support for application errors

Merge Checklist

  • PR has a Changeset
  • PR includes documentation if necessary
  • PR updates the boilerplates if necessary

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frames-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2024 1:39pm
framesjs-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2024 1:39pm

*/
constructor(message: string, status: number) {
if (message.length > 90) throw new Error("Message too long");
if (status < 400 || status >= 500) throw new Error("Invalid status code");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't allow 500?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, still weird decision but I understand that this is for UI feedback as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is little confusing because people could use it to return 500. Is that a way to disallow 500 at least on type level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do

@stephancill stephancill merged commit 9ce58be into dev Apr 4, 2024
7 checks passed
@stephancill stephancill deleted the feat/application-error-support branch April 4, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants