Good idea.

For localization it's also useful if you could pass through those codes in 
programmatic fashion:

int OakException#getErrorCode() // or even using enums - YMMV

Then applications can build their own localization dictionaries based on the 
(documented) error codes, without having to fiddle with the english exception 
messages.

Cheers,
Alex

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.


On 05.04.2013, at 13:27, Jukka Zitting <[email protected]> wrote:

> Hi,
> 
> I'd like to introduce error codes for the CommitFailedExceptions
> thrown by various commit hooks and other components.
> 
> Like the immediately recognizable (and nicely googleable) "ORA-NNNNN"
> codes used by the Oracle database, each individual Oak error condition
> should have it's own code in addition to a textual message that
> describes the issue. Something like "OakTypeNNNN" where "Type"
> indicates the error category (like "Constraint" for constraint and
> "Access" for access violations) and "NNNN" is a numeric code for that
> specific problem.
> 
> Such error coding should allow us to avoid the somewhat awkward
> CommitFailedException.throwRepositoryException() mechanism. And
> documentation about common error scenarios could easily evolve in the
> wiki with such error codes as page names.
> 
> BR,
> 
> Jukka Zitting

Reply via email to