[Trellis-developers] changes to error constants

Shaddy Zeineddine shaddy at learning.net
Tue Dec 11 13:13:41 PST 2007


Exceptions should always be thrown using TrellisException:

throw new TrellisException();

And now, to make use of the new error constants and messages, do this:

throw new TrellisException(NULL, TRELLIS_E_ERROR_CODE);

Using NULL will tell TrellisException to use the global error message. 
You can still use custom error messages like so:

throw new TrellisException('Error Message', TRELLIS_E_GENERAL);

Shaddy wrote:
> Before:
>
> EM_ERRORMESG = 'error message'
> EC_ERRORCODE = error code
>
>
> Now:
>
> TRELLIS_E_ERRORCODE = error code
> $TRELLIS_errors[TRELLIS_E_ERRORCODE] = 'error message'
>
>
> Benefits:
>
> messages can be customized on a per client or per mod basis
> error constant is prefixed with TRELLIS_ to ensure uniqueness
>
>
> Notes:
>
> Both methods will be available for use at first, all new errors will be 
> added in the new method only, support for the old method will be removed 
> once the core has been updated.
> _______________________________________________
> Trellis-developers mailing list
> Trellis-developers at trellis.learning.net
> http://trellis.learning.net/mailman/listinfo/trellis-developers
>   


More information about the Trellis-developers mailing list