Closed bjorng closed 3 years ago
Why pass only the first entry to the stacktrace and not the full stacktrace? The format_error function can extract the first entry on its own.
Saying this because the first entry in the stacktrace may not necessarily be the function the user was calling, it may be a second internal function, and a user format_error function may want to look at the second entry instead.
Why pass only the first entry to the stacktrace and not the full stacktrace? The format_error function can extract the first entry on its own.
After an internal discussion in the OTP team, we have decided to adopt your suggestion.
The OTP Technical Board approved the EEP, but requested a few changes:
The optional
module
andfunction
keys in the map will point the module and function for aformat_error
function.The arguments for
format_error
has been simplified to just two arguments: The exception reason and the first entry in stacktrace.Taken together, those to changes makes it easy to have one module with a
format_error/2
that can explain errors for multiple modules.