Skip to content

Commit

Permalink
Update RestXML error
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins committed Jan 27, 2024
1 parent 90ffa69 commit e638413
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Sources/Core/AWSClientRuntime/Errors/RestXMLError+AWS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import ClientRuntime
import class SmithyXML.Reader

extension RestXMLError {
/// Makes a `RestXMLError` from the provided `HttpResponse`.
Expand All @@ -15,13 +16,13 @@ extension RestXMLError {
/// - Returns: A`RestXMLError` instance with an error code of "NotFound" if the response body is empty and the status code is 404. Otherwise returns a `RestXMLError` by calling ``RestXMLError.init(httpResponse: HttpResponse)``.
///
/// - Throws: An error if it fails to decode the response body.
// public static func makeError(from httpResponse: HttpResponse, reader: SmithyXML.Reader) async throws -> RestXMLError {
// response.statusCodeIsNotFoundAndBodyIsEmpty
// ? .makeNotFoundError(requestID: response.requestId)
// : try await .init(reader, )
// }
//
// static func makeNotFoundError(requestID: String?) -> RestXMLError {
// return RestXMLError(code: "NotFound", type: "Sender", requestID: requestID)
// }
public static func makeError(from httpResponse: HttpResponse, reader: SmithyXML.Reader) async throws -> RestXMLError {

Check warning on line 19 in Sources/Core/AWSClientRuntime/Errors/RestXMLError+AWS.swift

View workflow job for this annotation

GitHub Actions / swiftlint

Line should be 120 characters or less; currently it has 122 characters (line_length)
httpResponse.statusCodeIsNotFoundAndBodyIsEmpty
? .makeNotFoundError(requestID: httpResponse.requestId)
: try await .init(responseReader: <#T##Reader#>, noErrorWrapping: <#T##Bool#>)
}

static func makeNotFoundError(requestID: String?) -> RestXMLError {
return RestXMLError(code: "NotFound", message: "404 Not Found", requestID: requestID)
}
}

0 comments on commit e638413

Please sign in to comment.