@@ -32,28 +32,28 @@ struct PlanetAPILogMiddleware: AsyncMiddleware {
32
32
let response = try await next. respond ( to: request)
33
33
Task . detached ( priority: . background) {
34
34
await MainActor . run {
35
- self . viewModel. addLog ( statusCode: response. status. code, originIP: originIP, requestURL: request. method. string + " " + request. url. path)
35
+ self . viewModel. addLog ( statusCode: response. status. code, originIP: originIP, requestURL: request. method. rawValue + " " + request. url. path)
36
36
}
37
37
}
38
38
return response
39
39
} catch let error as AbortError {
40
40
Task . detached ( priority: . utility) {
41
41
await MainActor . run {
42
- self . viewModel. addLog ( statusCode: error. status. code, originIP: originIP, requestURL: " \( request. method. string ) \( request. url. path) " , errorDescription: error. reason)
42
+ self . viewModel. addLog ( statusCode: error. status. code, originIP: originIP, requestURL: " \( request. method. rawValue ) \( request. url. path) " , errorDescription: error. reason)
43
43
}
44
44
}
45
45
throw error
46
46
} catch let error as DecodingError {
47
47
Task . detached ( priority: . utility) {
48
48
await MainActor . run {
49
- self . viewModel. addLog ( statusCode: error. status. code, originIP: originIP, requestURL: " \( request. method. string ) \( request. url. path) " , errorDescription: error. reason)
49
+ self . viewModel. addLog ( statusCode: error. status. code, originIP: originIP, requestURL: " \( request. method. rawValue ) \( request. url. path) " , errorDescription: error. reason)
50
50
}
51
51
}
52
52
throw error
53
53
} catch {
54
54
Task . detached ( priority: . utility) {
55
55
await MainActor . run {
56
- self . viewModel. addLog ( statusCode: 500 , originIP: originIP, requestURL: " \( request. method. string ) \( request. url. path) " , errorDescription: error. localizedDescription)
56
+ self . viewModel. addLog ( statusCode: 500 , originIP: originIP, requestURL: " \( request. method. rawValue ) \( request. url. path) " , errorDescription: error. localizedDescription)
57
57
}
58
58
}
59
59
throw error
0 commit comments