Skip to content

Commit

Permalink
Make sure OpenAPIGenerator reports errors properly
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Oct 12, 2024
1 parent 7ce484f commit 5ddd9c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lambdas/GHHooks/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FoundationEssentials
import Foundation
#endif

enum Errors: Error, CustomStringConvertible {
enum Errors: Error, CustomStringConvertible, LocalizedError {
case httpRequestFailed(response: any Sendable, file: String = #filePath, line: UInt = #line)
case headerNotFound(name: String, headers: AWSLambdaEvents.HTTPHeaders)
case multipleErrors([any Error])
Expand All @@ -20,4 +20,8 @@ enum Errors: Error, CustomStringConvertible {
return "multipleErrors(\(errors.map({ "\($0)" })))"
}
}

var errorDescription: String? {
self.description
}
}

0 comments on commit 5ddd9c7

Please sign in to comment.