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

Move to Throwable #765

Open
xsawyerx opened this issue Nov 17, 2014 · 3 comments
Open

Move to Throwable #765

xsawyerx opened this issue Nov 17, 2014 · 3 comments

Comments

@xsawyerx
Copy link
Member

Currently errors are handled poorly by Dancer2::Core::Error.

Using Throwable would be a major improvement and in the best direction. It will help remove a lot of code, keep the codebase clear, and our heads clean and relaxed. :)

People who hate D2::C::Error: @shumphrey, @mickeyn. :)

@mickeyn
Copy link
Contributor

mickeyn commented Nov 17, 2014

👍

(I really do hate that awful module :))

@racke
Copy link
Member

racke commented Nov 17, 2014

👍 Removing code in favour of a high quality CPAN module is almost always a good idea.

@xsawyerx
Copy link
Member Author

There are four types of errors:

  • User requested to return an error (send_error)
  • User code died (similar to send_error but uses the default code, has a stack trace, etc.)
  • Internal core code raised an exception (using an exception object)
  • Internal core code died (does not create an exception object)

We need to also think of serializers:

  • If there is a defined serializer, we should serialize the error
  • If there isn't a serializer, we should render an HTML

Funny enough, serializers could die too. Imagine serializing an exception object which then crashes. Another issue, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants