Skip to content

Commit 6f84ed8

Browse files
committed
Provide more information in error description for bad request
1 parent 3cfafe0 commit 6f84ed8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ComposableArchitecturePattern/Server+API.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public extension ServerAPI {
110110
throw ServerAPIError.badRequest(description: "\(httpMethod.rawValue) is not supported for this API.")
111111
}
112112
if self.strictEnvironmentEnforcement, (self.environment != nil && environment != self.environment) {
113-
throw ServerAPIError.badRequest(description: "API (\(self.id)) requires to use environment: \(self.environment?.description ?? "Unknown environment")")
113+
throw ServerAPIError.badRequest(description: "API (\(self.id)) requires to use environment: (\(self.environment?.description ?? "Unknown environment")) but instead (\(environment?.description ?? "Unknown environment")) was used.")
114114
}
115115

116116
let environment = self.environment ?? environment

0 commit comments

Comments
 (0)