1 |
|
2 | import { ValidationResult } from './ValidationResult';
|
3 | import { BadRequestException } from '../errors/BadRequestException';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class ValidationException extends BadRequestException {
|
14 | private static readonly SerialVersionUid;
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | constructor(correlationId: string, message?: string, results?: ValidationResult[]);
|
26 | /**
|
27 | * Composes human readable error message based on validation results.
|
28 | *
|
29 | * @param results a list of validation results.
|
30 | * @returns a composed error message.
|
31 | *
|
32 | * @see [[ValidationResult]]
|
33 | */
|
34 | static composeMessage(results: ValidationResult[]): string;
|
35 | /**
|
36 | * Creates a new ValidationException based on errors in validation results.
|
37 | * If validation results have no errors, than null is returned.
|
38 | *
|
39 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
40 | * @param results list of validation results that may contain errors
|
41 | * @param strict true to treat warnings as errors.
|
42 | * @returns a newly created ValidationException or null if no errors in found.
|
43 | *
|
44 | * @see [[ValidationResult]]
|
45 | */
|
46 | static fromResults(correlationId: string, results: ValidationResult[], strict: boolean): ValidationException;
|
47 | /**
|
48 | * Throws ValidationException based on errors in validation results.
|
49 | * If validation results have no errors, than no exception is thrown.
|
50 | *
|
51 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
52 | * @param results list of validation results that may contain errors
|
53 | * @param strict true to treat warnings as errors.
|
54 | *
|
55 | * @see [[ValidationResult]]
|
56 | * @see [[ValidationException]]
|
57 | */
|
58 | static throwExceptionIfNeeded(correlationId: string, results: ValidationResult[], strict: boolean): void;
|
59 | }
|