# Errors

Helper to check if an error is of a certain type.

- Source: [`core/lib/errors.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/errors.ts#L20)
- Type last changed: v2.201.0 · 13 Jun 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const errors = new cdk.Errors();
```

## Initializer

```ts
new Errors()
```

## Methods

- `isAssertionError(x: any): boolean` (static) — Test whether the given error is a AssertionError.

  An AssertionError is thrown when an assertion fails.

- `isAssumptionError(x: any): boolean` (static) — Test whether the given error is an AssumptionError.

  An AssumptionError is thrown when a construct made an assumption somewhere that doesn't hold true.
  This error always indicates a bug in the construct.

- `isCloudAssemblyError(x: any): boolean` (static) — Test whether the given error is a CloudAssemblyError.

  A CloudAssemblyError is thrown for unexpected problems with the synthesized assembly.

- `isConstructError(x: any): boolean` (static) — Test whether the given errors is a ConstructionError.

  A ConstructionError is a generic error that will be thrown during the App construction or synthesis.
  To check for more specific errors, use the respective methods.

- `isExecutionError(x: any): boolean` (static) — Test whether the given error is an ExecutionError.

  An ExecutionError is thrown if an externally executed script or code failed.

- `isValidationError(x: any): boolean` (static) — Test whether the given error is a ValidationError.

  A ValidationError is thrown when input props are failing to pass the rules of the construct.
  It usually means the underlying CloudFormation resource(s) would not deploy with a given configuration.
