class ValidationResult
Language | Type name |
---|---|
.NET | Amazon.CDK.ValidationResult |
Go | github.com/aws/aws-cdk-go/awscdk/v2#ValidationResult |
Java | software.amazon.awscdk.ValidationResult |
Python | aws_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
Validation
Results
Properties
Name | Type | Description |
---|---|---|
error | string | |
is | boolean | |
results | Validation |
errorMessage
Type:
string
isSuccess
Type:
boolean
results
Type:
Validation
Methods
Name | Description |
---|---|
assert | Turn a failed validation into an exception. |
error | Return a string rendering of the tree of validation failures. |
prefix(message) | Wrap this result with an error message, if it concerns an error. |
Success()
assertpublic assertSuccess(): void
Turn a failed validation into an exception.
Tree()
errorpublic 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
Wrap this result with an error message, if it concerns an error.