Skip to content

Commit

Permalink
Resolve code style PR nits.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sichan Yoo committed Sep 12, 2023
1 parent 45dce4e commit c29dd2e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ class AWSJsonHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGenerat
write("if let error = serviceError { return error }")

openBlock("switch restJSONError.errorType {", "}") {
val errorShapes =
op.errors.map { ctx.model.expectShape(it) as StructureShape }.toSet().sorted()
val errorShapes = op.errors
.map { ctx.model.expectShape(it) as StructureShape }
.toSet()
.sorted()
errorShapes.forEach { errorShape ->
var errorShapeName = errorShape.errorShapeName(ctx.symbolProvider)
var errorShapeType = ctx.symbolProvider.toSymbol(errorShape).name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ class AWSEc2QueryHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGen
write("if let error = serviceError { return error }")

openBlock("switch ec2QueryError.errorCode {", "}") {
val errorShapes =
op.errors.map { ctx.model.expectShape(it) as StructureShape }.toSet().sorted()
val errorShapes = op.errors
.map { ctx.model.expectShape(it) as StructureShape }
.toSet()
.sorted()
errorShapes.forEach { errorShape ->
var errorShapeName = errorShape.errorShapeName(ctx.symbolProvider)
var errorShapeType = ctx.symbolProvider.toSymbol(errorShape).name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ class AWSRestJson1HttpResponseBindingErrorGeneratable : HttpResponseBindingError
write("if let error = serviceError { return error }")

openBlock("switch restJSONError.errorType {", "}") {
val errorShapes =
op.errors.map { ctx.model.expectShape(it) as StructureShape }.toSet().sorted()
val errorShapes = op.errors
.map { ctx.model.expectShape(it) as StructureShape }
.toSet()
.sorted()
errorShapes.forEach { errorShape ->
var errorShapeName = errorShape.errorShapeName(ctx.symbolProvider)
var errorShapeType = ctx.symbolProvider.toSymbol(errorShape).name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ class AWSRestXMLHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGene
ClientRuntimeTypes.Serde.ResponseDecoder,
SwiftTypes.Error
) {
val errorShapes = op.errors.map { ctx.model.expectShape(it) as StructureShape }.toSet().sorted()
val errorShapes = op.errors
.map { ctx.model.expectShape(it) as StructureShape }
.toSet()
.sorted()
val context = mapOf<String, Any>(
"operationErrorName" to operationErrorName,
"ctx" to ctx,
Expand Down

0 comments on commit c29dd2e

Please sign in to comment.