ConflictException class

Exception for HTTP 409 Conflict errors.

Thrown when the request conflicts with the current server state, such as:

  • Attempting to create a duplicate vehicle (same VRN)
  • Editing data that was modified by another user
  • Race conditions in concurrent operations

The default message suggests refreshing data to resolve the conflict.

Example:

if (response.statusCode == 409) {
  throw ConflictException(
    message: 'Vehicle with VRN ABC123 already exists',
    originalException: dioError,
  );
}
Inheritance

Constructors

ConflictException({String? message, DioException? originalException, String? errorCode, String? traceId})
Creates a ConflictException with an optional custom message.
const

Properties

errorCode String?
A machine-readable error code from the backend's ErrorResponse envelope (e.g. VALIDATION_ERROR, TOO_MANY_REQUESTS), or null if the response body didn't match that schema.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
message String
A human-readable description of the error.
finalinherited
originalException DioException?
The underlying Dio exception that caused this network error.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
traceId String?
The backend's request-trace identifier from the ErrorResponse envelope, for correlating this error with server-side logs — or null if the response body didn't match that schema.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
The string representation of this exception, including Dio-level details.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited