lib/error: Keep track of the origin of an error #44

Open
opened 2022-08-15 09:43:48 +02:00 by BodgeMaster · 1 comment

Where was it thrown? Did it come from the function I called or was it passed up from another function further down the call stack?

Where was it thrown? Did it come from the function I called or was it passed up from another function further down the call stack?
BodgeMaster added the
Enhancement
label 2022-08-15 09:43:48 +02:00
BodgeMaster changed title from lib/error: Add some way to keep track of the origin of an error to lib/error: Keep track of the origin of an error 2022-08-15 09:44:01 +02:00

Ideas for that:

  • for every error, keep track of where it came from using compiler macros (__FILE__ and __LINE__?)
  • store a pointer to an instance of ErrorOr or ErrorOrVoid somewhere to be passed down with each error
  • use macros or functions for both instantiating and handling errors to automatically create and clean up the pointer and pass down errors
Ideas for that: - for every error, keep track of where it came from using compiler macros (`__FILE__` and `__LINE__`?) - store a pointer to an instance of ErrorOr or ErrorOrVoid somewhere to be passed down with each error - use macros or functions for both instantiating and handling errors to automatically create and clean up the pointer and pass down errors
Sign in to join this conversation.
There is no content yet.