Skip to content

Commit

Permalink
Fix: ErrorResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Scuderi committed Aug 3, 2019
1 parent 5d58891 commit 3f7d56a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/AWSLambdaSwift/Runtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public typealias JSONDictionary = [String: Any]

struct InvocationError: Codable {
let errorMessage: String
let errorType: String
}

public class Runtime {
Expand Down Expand Up @@ -62,8 +63,9 @@ public class Runtime {
}

func postInvocationError(for requestId: String, error: Error) {
let errorMessage = String(describing: error)
let invocationError = InvocationError(errorMessage: errorMessage)
let errorMessage = error.localizedDescription
let invocationError = InvocationError(errorMessage: errorMessage,
errorType: "PostInvocationError")
let jsonEncoder = JSONEncoder()
let httpBody = try? jsonEncoder.encode(invocationError)

Expand Down

0 comments on commit 3f7d56a

Please sign in to comment.