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.
Initializers
import { ValidationResult } from '@alicloud/ros-cdk-core'
new ValidationResult(errorMessage?: string, results?: ValidationResults)
Name | Type | Description |
---|---|---|
errorMessage |
string |
No description. |
results |
ValidationResults |
No description. |
errorMessage
Optional
- Type: string
results
Optional
- Type: ValidationResults
Methods
Name | Description |
---|---|
assertSuccess |
Turn a failed validation into an exception. |
errorTree |
Return a string rendering of the tree of validation failures. |
prefix |
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
Return a string rendering of the tree of validation failures.
prefix
public prefix(message: string): ValidationResult
Wrap this result with an error message, if it concerns an error.
- Type: string
Properties
Name | Type | Description |
---|---|---|
errorMessage |
string |
No description. |
isSuccess |
boolean |
No description. |
results |
ValidationResults |
No description. |
errorMessage
Required
public readonly errorMessage: string;
- Type: string
isSuccess
Required
public readonly isSuccess: boolean;
- Type: boolean
results
Required
public readonly results: ValidationResults;
- Type: ValidationResults