ValidationException class

Errors in schema validation.

Validation errors are usually generated based in ValidationResult. If using strict mode, warnings will also raise validation exceptions.

See BadRequestException See ValidationResult

Inheritance

Constructors

ValidationException(String correlationId, [ String message, List<ValidationResult> results ])
Creates a new instance of validation exception and assigns its values. [...]

Properties

category ↔ String
Standard error category
read / write, inherited
cause ↔ String
read / write, inherited
code ↔ String
A unique error code
read / write, inherited
correlation_id ↔ String
A unique transaction id to trace execution throug call chain
read / write, inherited
details StringValueMap
A map with additional details that can be used to restore error description in other languages
read / write, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
message ↔ String
A human-readable error description (usually written in English)
read / write, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
stack_trace ↔ String
Stack trace of the exception
read / write, inherited
status ↔ int
HTTP status code associated with this error type
read / write, inherited

Methods

getCauseString() → String
Gets original error wrapped by this exception as a string message. [...]
inherited
getStackTraceString() → String
Gets a stack trace where this exception occured. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setCauseString(String value) → void
Sets original error wrapped by this exception as a string message. [...]
inherited
setStackTraceString(String value) → void
Sets a stack trace where this exception occured. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited
withCause(dynamic cause) ApplicationException
Sets a original error wrapped by this exception [...]
inherited
withCode(String code) ApplicationException
Sets a unique error code. [...]
inherited
withCorrelationId(String correlationId) ApplicationException
Sets a correlation id which can be used to trace this error through a call chain. [...]
inherited
withDetails(String key, dynamic value) ApplicationException
Sets a parameter for additional error details. This details can be used to restore error description in other languages. [...]
inherited
withStackTrace(String stackTrace) ApplicationException
Sets a stack trace for this error. [...]
inherited
withStatus(int status) ApplicationException
Sets a HTTP status code which shall be returned by REST calls. [...]
inherited
wrap(dynamic cause) ApplicationException
Wraps another exception into an application exception object. [...]
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Static Properties

SerialVersionUid → int
final

Static Methods

composeMessage(List<ValidationResult> results) → String
Composes human readable error message based on validation results. [...]
fromResults(String correlationId, List<ValidationResult> results, bool strict) ValidationException
Creates a new ValidationException based on errors in validation results. If validation results have no errors, than null is returned. [...]
throwExceptionIfNeeded(String correlationId, List<ValidationResult> results, bool strict) → void
Throws ValidationException based on errors in validation results. If validation results have no errors, than no exception is thrown. [...]