XT.
Error
A standard error object. Standard errors are created and pushed into
`XT.errors` on application startup. You should use the `clone` function
to find and create a copy of an error for use in reporting in the
application. Errors may include one or more parameters that can be replaced
at runtime to add context to the error message.
var params, err;
params = {
attr: 'name',
type: 'String'
}
err = XT.Error.clone('xt1003', { params: params });
return err.message(); // returns "The value of 'name' must be type: String."
Note: You should always use `clone` to make an error rather than reference
the error from `XT.errors` directly. Otherwise if you set `params` on the
orginial error, you will be setting parameters for that error globally.