Error-Writing Conventions

  • Each error is identified by an error message code and an array of arguments (int, String[]). A combination of a message code and an array of arguments defines a specific error. The array of parameters can be null.

  • Each error code is mapped to a short message which is a fixed string and a detailed message which is a template string contains zero or more arguments. Matching is assumed between the number of arguments in the template and the actual number of parameters.

  • Example of Error Message Code:

    10234 may represent an error with the short message:

    Connection Error
    

    and the detailed message:

    Could not connect via {0} protocol due to timeout of {1} msec
    

    where

    {0} = the first argument: a protocol name

    {1} = the second argument: the timeout length in msec