File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Tests/AWSLambdaRuntimeTests Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ import FoundationEssentials
2525import Foundation
2626#endif
2727
28+ #if canImport(FoundationNetworking)
29+ import FoundationNetworking
30+ #else
31+ import Foundation
32+ #endif
33+
2834extension LambdaRuntimeTests {
2935
3036 @Test ( " Local server respects LOCAL_LAMBDA_PORT environment variable " )
@@ -159,7 +165,11 @@ extension LambdaRuntimeTests {
159165 let ( data, response) = try await URLSession . shared. data ( for: request)
160166
161167 guard let httpResponse = response as? HTTPURLResponse else {
162- throw URLError ( . badServerResponse)
168+ // Create a custom error since URLError might not be available on Linux
169+ struct HTTPError : Error {
170+ let message : String
171+ }
172+ throw HTTPError ( message: " Bad server response " )
163173 }
164174
165175 return ( data, httpResponse)
You can’t perform that action at this time.
0 commit comments