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
-
- Object
- KoolbaseStorageException
- KoolbaseStorageConflictException
Constructors
- KoolbaseStorageConflictException([String message = 'An object already exists at this path', String? path])
-
const
Properties
- code → String?
-
The server's stable error code, when present.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
Human-readable message from the server (or a sensible default).
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