bvanhoekelen/performance

Use exceptions instead of die

Closed this issue · 2 comments

I think, library should use exceptions instead of die for generating errors, they have next benefits:

  • do not stop app immediately
  • provides backtrace
  • allows to change error handling in future

I encountered the following problem when I tried to use the library. I tried to profile one API route and created several points with the same name, which is not allowed in the library and throws an error. But for some time I could not understand what the error was, since the route returned the code 200. When I saw the text of the error, I could not understand for a long time exactly where I had made the error. Exceptions in such cases are more expected and convenient.

I totally agree with that the library should use exceptions instead of die. This will be fixed in the next version.

Thanks for your feedback.

See version v2.5.0