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. |
errorMessageOptional
- Type: string
resultsOptional
- 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. |
errorMessageRequired
public readonly errorMessage: string;
- Type: string
isSuccessRequired
public readonly isSuccess: boolean;
- Type: boolean
resultsRequired
public readonly results: ValidationResults;
- Type: ValidationResults