ire4ever1190 / mike

The new and improved mikero web framework
35 stars 1 forks source link

Uses methods for error handling #27

Closed ire4ever1190 closed 12 months ago

ire4ever1190 commented 12 months ago

Finding a handler for an error is now done via methods instead of using a table. This means the lookup is cleaner than before (Two exceptions having the same name won't collide anymore) and also means it supports catching child exceptions

type
  Parent = object of CatchableError
  Child = object of Parent

# If the child exception is thrown, it can be handled here
Parent -> thrown:
 # ... 

Performance is basically on par. Might actually be faster once Nim implements better dispatch for ORC (Think I saw a PR, don't know if it was merged)