Skip to content

Commit 50243ac

Browse files
committed
[UPDATE] fix error message with full error description.
1 parent ec6900d commit 50243ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/KurrentDB/Core/Error/KurrentError.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ func withRethrowingError<T>(usage: String, action: @Sendable () async throws ->
154154
} catch let error as RPCError {
155155
try error.rethrow(usage: usage, origin: error)
156156
} catch {
157-
throw .internalClientError(reason: "\(usage) failed. error: \(error)")
157+
throw .internalClientError(reason: "`\(usage)` failed. full error: \(error)")
158158
}
159-
throw .internalClientError(reason: "\(usage) failed.")
159+
throw .internalClientError(reason: "`\(usage)` failed.")
160160
}
161161

162162
func withRethrowingError<T>(usage: String, action: @Sendable () throws -> T) throws(KurrentError) -> T {
@@ -167,9 +167,9 @@ func withRethrowingError<T>(usage: String, action: @Sendable () throws -> T) thr
167167
} catch let error as RPCError {
168168
try error.rethrow(usage: usage, origin: error)
169169
} catch {
170-
throw .internalClientError(reason: "\(usage) failed. error: \(error)")
170+
throw .internalClientError(reason: "`\(usage)` failed. full error: \(error)")
171171
}
172-
throw .internalClientError(reason: "\(usage) failed.")
172+
throw .internalClientError(reason: "`\(usage)` failed.")
173173
}
174174

175175
extension Error where Self: Equatable {
@@ -194,7 +194,7 @@ extension IOError {
194194
case 61:
195195
throw .grpcConnectionError(cause: origin)
196196
default:
197-
throw .internalClientError(reason: "Unknown \(usage) error")
197+
throw .internalClientError(reason: "`\(usage)` failed, full error: \(origin).")
198198
}
199199
}
200200
}

0 commit comments

Comments
 (0)