## org.exist.xquery.util
Class Error

    java.lang.Object
      org.exist.xquery.util.Error

public class Error
extends java.lang.Object

Class used to pass an error context to subordinate expressions. Most XQuery classes delegate dynamic type and cardinality checks to classes like `DynamicCardinalityCheck` or `DynamicTypeCheck`. Those classes don't know the context in which they were called and thus can't produce meaningful error messages. Class Error can be used to pass runtime error descriptions from the top-level object to the lower-level objects. This class also defines some static constants for various error messages. The final formatting of the message is done by class `Messages`.

Author:
  wolf

Field Summary
`static java.lang.String` `FUNC_EMPTY_SEQ_DISALLOWED`
`static java.lang.String` `FUNC_NOT_FOUND`
`static java.lang.String` `FUNC_PARAM_CARDINALITY`
`static java.lang.String` `FUNC_PARAM_TYPE`
`static java.lang.String` `FUNC_PARAM_TYPE_STATIC`
`static java.lang.String` `FUNC_RETURN_CARDINALITY`
`static java.lang.String` `FUNC_RETURN_TYPE`
`static java.lang.String` `NODE_COMP_TYPE_MISMATCH`
`static java.lang.String` `TYPE_MISMATCH`
`static java.lang.String` `UPDATE_EMPTY_CONTENT`
`static java.lang.String` `UPDATE_REPLACE_ELEM_TYPE`
`static java.lang.String` `UPDATE_SELECT_TYPE`
`static java.lang.String` `VAR_TYPE_MISMATCH`

Constructor Summary
`Error(java.lang.String errCode)` Creates a new error with the specified message id.
`Error(java.lang.String errCode, java.lang.Object arg1)` Creates a new error with the specified message id and adds a single argument to the argument list for the error message.
`Error(java.lang.String errCode, java.lang.Object arg1, java.lang.Object arg2)`

Method Summary
`void` `addArg(java.lang.Object arg)` Add an argument to the argument list for the error message.
`void` `addArgs(java.lang.Object[] nargs)`
`void` `addArgs(java.lang.Object arg1, java.lang.Object arg2)`
`void` `addArgs(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)`
`java.lang.Object[]` `getArgs()`
`java.lang.String` `getErrorCode()`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### FUNC_RETURN_CARDINALITY

    public static final java.lang.String FUNC_RETURN_CARDINALITY

See Also:
  Constant Field Values

### FUNC_PARAM_CARDINALITY

    public static final java.lang.String FUNC_PARAM_CARDINALITY

See Also:
  Constant Field Values

### FUNC_RETURN_TYPE

    public static final java.lang.String FUNC_RETURN_TYPE

See Also:
  Constant Field Values

### TYPE_MISMATCH

    public static final java.lang.String TYPE_MISMATCH

See Also:
  Constant Field Values

### NODE_COMP_TYPE_MISMATCH

    public static final java.lang.String NODE_COMP_TYPE_MISMATCH

See Also:
  Constant Field Values

### FUNC_PARAM_TYPE

    public static final java.lang.String FUNC_PARAM_TYPE

See Also:
  Constant Field Values

### VAR_TYPE_MISMATCH

    public static final java.lang.String VAR_TYPE_MISMATCH

See Also:
  Constant Field Values

### UPDATE_SELECT_TYPE

    public static final java.lang.String UPDATE_SELECT_TYPE

See Also:
  Constant Field Values

### UPDATE_EMPTY_CONTENT

    public static final java.lang.String UPDATE_EMPTY_CONTENT

See Also:
  Constant Field Values

### UPDATE_REPLACE_ELEM_TYPE

    public static final java.lang.String UPDATE_REPLACE_ELEM_TYPE

See Also:
  Constant Field Values

### FUNC_EMPTY_SEQ_DISALLOWED

    public static final java.lang.String FUNC_EMPTY_SEQ_DISALLOWED

See Also:
  Constant Field Values

### FUNC_PARAM_TYPE_STATIC

    public static final java.lang.String FUNC_PARAM_TYPE_STATIC

See Also:
  Constant Field Values

### FUNC_NOT_FOUND

    public static final java.lang.String FUNC_NOT_FOUND

See Also:
  Constant Field Values

Constructor Detail

### Error

    public Error(java.lang.String errCode)

  Creates a new error with the specified message id.

Parameters:
  `errCode` - the message id for this error.

### Error

    public Error(java.lang.String errCode,
                 java.lang.Object arg1)

  Creates a new error with the specified message id and adds a single argument to the argument list for the error message.

Parameters:
  `errCode` -
  `arg1` -

### Error

    public Error(java.lang.String errCode,
                 java.lang.Object arg1,
                 java.lang.Object arg2)

Method Detail

### addArg

    public void addArg(java.lang.Object arg)

  Add an argument to the argument list for the error message.

  Parameters:
    `arg` -

### addArgs

    public void addArgs(java.lang.Object arg1,
                        java.lang.Object arg2)

### addArgs

    public void addArgs(java.lang.Object arg1,
                        java.lang.Object arg2,
                        java.lang.Object arg3)

### addArgs

    public void addArgs(java.lang.Object[] nargs)

### toString

    public java.lang.String toString()

### getErrorCode

    public java.lang.String getErrorCode()

### getArgs

    public java.lang.Object[] getArgs()

Copyright (C) Wolfgang Meier. All rights reserved.