Extension of the native JavaScript Error
type that includes a stack trace.
Remarks
yFiles includes the following specialized exception types indicated by the name:
- ArgumentError – Indicates that the value of a parameter of the current method is illegal.
- ArgumentNullError – Indicates that the value of a parameter of the current method is
null
but a non-null
value was expected. - ArgumentOutOfRangeError – Indicates that the value of a parameter of the current method is not in the legal range of values.
- IndexOutOfRangeError – Indicates that an array index is not in the legal range.
- NullReferenceError – Indicates that a value is
null
when it shouldn't. - InvalidOperationError – Indicates that the current operation is not valid in the instances's current state.
- NotImplementedError – Indicates that the called method is not implemented.
- NotSupportedError – Indicates that the operation is not supported.
- ArithmeticError – Indicates an error in an arithmetic operation.
- IOError – Indicates an error during an IO operation.
- KeyNotFoundError – Indicates that a mapping does not contain the given key.
- AlgorithmAbortedError – Indicates that an immediate termination request was detected by an algorithm.
- InvalidGraphStructureError – Indicates that a graph cannot be used with a certain algorithm. Some graph algorithms require a specific graph structure, for example trees or planar graph. These algorithms throw this error if a non-matching graph is used.
This type also provides the static catchErrors property, which when enabled, causes most entry points (e.g. event listeners) to use try/catch blocks to catch possible errors that could be thrown during event handling. The errors are handled by the handleError function, which calls the handler function, if it has been set. Note that for some browsers/plugins, try/catch blocks prevent error debugging functionality. Hence, catchErrors should be turned off while debugging.
Type Details
- yfiles module
- lang
- yfiles-umd modules
- All modules
- Legacy UMD name
- yfiles.lang.Exception
Constructors
Creates a new exception with the given message and an optional error name.
Parameters
A map of options to pass to the method.
- message - string
- The exception message.
- name - string
- The exception name. This name can be used in try...catch statements to distinguish between different types of errors.
- cause - Exception
- The inner exception, if another exception was wrapped.
See Also
Default Properties
Whether to use try/catch blocks when invoking event handlers.
Remarks
If catchErrors is enabled, any caught errors are passed to this function.
Remarks
Signature Details
function(obj: any)
Parameters
- obj - any
- The parameter of the method that this delegate encapsulates.
Static Methods
This function is called in catch blocks in the library if catchErrors is enabled.
Remarks
true
the error is logged to the console using console.warn
if available.Parameters
A map of options to pass to the method.
- error - Object
- The error object that has been caught