class Errors
Language | Type name |
---|---|
![]() | Amazon.CDK.Errors |
![]() | github.com/aws/aws-cdk-go/awscdk/v2#Errors |
![]() | software.amazon.awscdk.Errors |
![]() | aws_cdk.Errors |
![]() | aws-cdk-lib » Errors |
Helper to check if an error is of a certain type.
Example
// 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
new Errors()
Methods
Name | Description |
---|---|
static is | Test whether the given error is a AssertionError. |
static is | Test whether the given error is a CloudAssemblyError. |
static is | Test whether the given errors is a ConstructionError. |
static is | Test whether the given error is a ValidationError. |
static isAssertionError(x)
public static isAssertionError(x: any): boolean
Parameters
- x
any
Returns
boolean
Test whether the given error is a AssertionError.
An AssertionError is thrown when an assertion fails.
static isCloudAssemblyError(x)
public static isCloudAssemblyError(x: any): boolean
Parameters
- x
any
Returns
boolean
Test whether the given error is a CloudAssemblyError.
A CloudAssemblyError is thrown for unexpected problems with the synthesized assembly.
static isConstructError(x)
public static isConstructError(x: any): boolean
Parameters
- x
any
Returns
boolean
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.
static isValidationError(x)
public static isValidationError(x: any): boolean
Parameters
- x
any
Returns
boolean
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.