Make error messages more useful: add a URI
Benjamin Kaduk
kaduk at MIT.EDU
Fri Oct 3 12:07:34 EDT 2014
On Thu, 2 Oct 2014, Nico Williams wrote:
>
> Roland suggests:
>
> [libdefaults]
>
> err_fmt = %E. Please see https://whatever.example/%N
>
> where %E is whatever the error string would have been and %N is the
> error code number (or symbolic name for it).
>
> The default would be %E.
>
> Additional contextual information could be provided with other tokens.
>
> This would allow sites to use URIs or some other non-URI string if they
> prefer.
This seems plausible, though I still am interested in hearing more
feedback if we can get it.
I'm slightly concerned that supporting more %foo tokens for expansion
would lead to an API explosion at call sites that set the error message.
Adding N new optional positional parameters to krb5_set_error_message to
hold all the possible values seems bad. Adding a single struct parameter
to hold them all might be bad. A single parameter to the head of a linked
list of containers holding type-tagged data is probably too complex;
adding separate routines to add a single expandable value to the context
might make call sites too noisy, depending on how common it is to set
extra attributes.
Did you have anything in particular in mind?
-Ben
More information about the krbdev
mailing list