ITwinError Namespace

Function

Name Description
ITwinError.create Instantiate a new ITwinError or subtype thereof.
ITwinError.isError Determine whether an error object was thrown by iTwin.js and has a specific scope and key.
ITwinError.throwError Instantiate and immediately throw an ITwinError.

Defined in

ITwinError Interface

The interface that all exceptions thrown by iTwin.js libraries and applications should implement. Specific kinds of ITwinErrors are identified by an ITwinErrorId that allows programmers to identify errors when they are caught without relying on specific class hierarchies, which is especially important when errors are marshalled across process boundaries. You can extend ITwinError to add properties that provide programmers with additional context for a particular kind of error. When catching errors, programmers can use isError to determine if the error is of a specific sub-type, and if so access the additional properties. Those additional properties will also be logged as metadata by logException.

Extends

  • Error

Properties

Name Type Description
iTwinErrorId Readonly ITwinErrorId Uniquely identifies the kind of error.  

Defined in

Last Updated: 04 April, 2025