KoolbaseStorageConflictException class

Thrown when an upload is rejected because an object already exists at the requested path — the server responds with 409 Conflict and code path_conflict. Catch this to give the user an "overwrite this file?" prompt, then retry the upload with overwrite: true.

path is the colliding path the server rejected, surfaced from the response body for diagnostics and UI.

try {
  await Koolbase.storage.upload(
    bucket: 'avatars',
    path: 'me.png',
    file: file,
  );
} on KoolbaseStorageConflictException catch (e) {
  final ok = await confirmDialog('${e.path} already exists. Overwrite?');
  if (ok) {
    await Koolbase.storage.upload(
      bucket: 'avatars',
      path: 'me.png',
      file: file,
      overwrite: true,
    );
  }
}
Inheritance

Constructors

KoolbaseStorageConflictException([String message = 'An object already exists at this path', String? path])
const

Properties

code → String?
The server's stable error code, when it sent one. Prefer branching on the exception type; this is for logging and for codes the SDK does not yet map.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
message → String
What went wrong, in words. From the server where it said something useful.
finalinherited
path → String?
The path that collided with an existing object.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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