jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Oak error codes
Date Tue, 09 Apr 2013 06:16:40 GMT
Hi,

On Mon, Apr 8, 2013 at 6:42 PM, Alexander Klimetschek
<aklimets@adobe.com> wrote:
> For localization it's also useful if you could pass through those codes in programmatic
fashion:
>
> int OakException#getErrorCode() // or even using enums - YMMV

Yep. I'm thinking of using a string for the "Type" part and an integer
code for the "NNNN" one, with the wiki used as an informal registry of
types and codes. That should fit the pluggable nature of Oak better
than a fixed set of Enum values.

> PS: Note that I am not talking about Java's Throwable#getLocalizedMessage(), as that's
> generally useless, because the backend such as Oak usually does not and should not
> know about the current UI language.

Agreed. A better approach is the one used for example in HTTP where a
"404 Not found" response results in a localized error message based on
the browser interpreting the "404" error code and ignoring the "Not
found" part (and typically also the body of the response).

BR,

Jukka Zitting

Mime
View raw message