Class: AWSCDK::Errors

Inherits:
Jsii::Object
  • Object
show all
Defined in:
errors.rb

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrors

Returns a new instance of Errors.



8
9
10
# File 'errors.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.is_assertion_error(x) ⇒ Boolean

Test whether the given error is a AssertionError.

An AssertionError is thrown when an assertion fails.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


23
24
25
26
# File 'errors.rb', line 23

def self.is_assertion_error(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Errors", "isAssertionError", [x])
end

.is_assumption_error(x) ⇒ Boolean

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.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


35
36
37
38
# File 'errors.rb', line 35

def self.is_assumption_error(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Errors", "isAssumptionError", [x])
end

.is_cloud_assembly_error(x) ⇒ Boolean

Test whether the given error is a CloudAssemblyError.

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

Parameters:

  • x (Object)

Returns:

  • (Boolean)


46
47
48
49
# File 'errors.rb', line 46

def self.is_cloud_assembly_error(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Errors", "isCloudAssemblyError", [x])
end

.is_construct_error(x) ⇒ 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.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


58
59
60
61
# File 'errors.rb', line 58

def self.is_construct_error(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Errors", "isConstructError", [x])
end

.is_execution_error(x) ⇒ Boolean

Test whether the given error is an ExecutionError.

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

Parameters:

  • x (Object)

Returns:

  • (Boolean)


69
70
71
72
# File 'errors.rb', line 69

def self.is_execution_error(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Errors", "isExecutionError", [x])
end

.is_validation_error(x) ⇒ 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.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


81
82
83
84
# File 'errors.rb', line 81

def self.is_validation_error(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.Errors", "isValidationError", [x])
end

.jsii_overridable_methodsObject



12
13
14
15
# File 'errors.rb', line 12

def self.jsii_overridable_methods
  {
  }
end