Currently, showerror can be implemented by package developers as:
function Base.showerror(io::IO, err::MyErrorType)
write(io, "...")
end
My request is that we document a new pattern of defining an additional show method with a MIME type, similar to Base.show:
function Base.showerror(io::IO, ::MIME"text/html", err::MyErrorType)
write(io, "...")
end
The HTML mime type is my motivating use case. This would allow package developers to define richer error messages for notebooks. You could use headers (text size), hyperlinks, formatted code snippets, images with diagrams, collapsable sections with more debugging info, and more.
Currently,
showerror
can be implemented by package developers as:My request is that we document a new pattern of defining an additional show method with a MIME type, similar to
Base.show
:The HTML mime type is my motivating use case. This would allow package developers to define richer error messages for notebooks. You could use headers (text size), hyperlinks, formatted code snippets, images with diagrams, collapsable sections with more debugging info, and more.
For REPL users, nothing would change.