Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Sources/MauriNet/Global/NetworkError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public enum NetworkError: Int, Error, CaseIterable, Sendable {
/// Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file which is older than the one already on the server resulting in a version control conflict. Source: [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409)
case conflictOnResource = 409

/// Indicates that the target resource is no longer available and this condition is likely to be permanent.
///
/// Unlike 404, it signals the resource existed and was intentionally removed — clients should not retry. Source: [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410)
case gone = 410

/// Indicates that access to the target reSource has been denied.
///
/// This happens with conditional requests on methods other than GET or HEAD when the condition defined by the If-Unmodified-Since or If-None-Match headers is not fulfilled. In that case, the request, usually an upload or a modification of a reSource, cannot be made and this error response is sent back. Source: [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412)
Expand Down Expand Up @@ -106,6 +111,8 @@ public enum NetworkError: Int, Error, CaseIterable, Sendable {
return "Request was cancelled"
case .conflictOnResource:
return "There's an internal conflict with the requested reSource"
case .gone:
return "The requested reSource is permanently gone"
case .preconditionFailed:
return "Precondition failed for this request"
case .serviceUnavailable:
Expand Down
Loading