[erlang-patches] format_status analog for error_info
Andrew Thompson
andrew@REDACTED
Wed Feb 24 23:59:59 CET 2010
On Wed, Feb 24, 2010 at 05:22:48PM -0500, Steve Vinoski wrote:
>
> I think since format_status is already an optional export, reusing it for
> the purposes you mention would make sense. Probably not much point in
> inventing another mechanism to do something similar, and overloading
> existing functions (like terminate) has a chance of breaking something.
> Since format_status is new (again! :-) ) the chance of breaking anything by
> reusing it for this is pretty much nil.
>
The reason I was a little leery of format_status was that its return
value is a little odd to my eyes, is that format standardized at all or
can it be more or less freeform (even missing the "State" key)?
Using format_status for this has the happy side effect of ensuring that
neither sys:get_status or an error log message will choke and die on
trying to prettyprint a gigantic term. Maybe we could call format_status
with a different first argument to indicate that the status is for an
error, not for normal operation?
Andrew
More information about the erlang-patches
mailing list