aws-cdk-lib.ValidationResult

class ValidationResult

LanguageType name
.NETAmazon.CDK.ValidationResult
Gogithub.com/aws/aws-cdk-go/awscdk/v2#ValidationResult
Javasoftware.amazon.awscdk.ValidationResult
Pythonaws_cdk.ValidationResult
TypeScript (source)aws-cdk-lib » ValidationResult

Representation of validation results.

Models a tree of validation errors so that we have as much information as possible about the failure that occurred.

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';

declare const validationResults: cdk.ValidationResults;
const validationResult = new cdk.ValidationResult(/* all optional props */ 'errorMessage', /* all optional props */ validationResults);

Initializer

new ValidationResult(errorMessage?: string, results?: ValidationResults)

Parameters

  • errorMessage string
  • results ValidationResults

Properties

NameTypeDescription
errorMessagestring
isSuccessboolean
resultsValidationResults

errorMessage

Type: string


isSuccess

Type: boolean


results

Type: ValidationResults

Methods

NameDescription
assertSuccess()Turn a failed validation into an exception.
errorTree()Return a string rendering of the tree of validation failures.
prefix(message)Wrap this result with an error message, if it concerns an error.

assertSuccess()

public assertSuccess(): void

Turn a failed validation into an exception.


errorTree()

public errorTree(): string

Returns

  • string

Return a string rendering of the tree of validation failures.


prefix(message)

public prefix(message: string): ValidationResult

Parameters

  • message string

Returns

  • ValidationResult

Wrap this result with an error message, if it concerns an error.