Skip to content

Commit

Permalink
Improve error reporting for EncodingError and DecodingError (#2981)
Browse files Browse the repository at this point in the history
Improve error reporting for EncodingError and DecodingError.

Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
  • Loading branch information
grahamburgsma and 0xTim committed Jul 5, 2023
1 parent 38cb397 commit 1baf623
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Vapor/Logging/Logger+Report.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ extension Logger {
reason = abort.reason
source = nil
level = .warning
case let encoding as EncodingError:
reason = "\(encoding)"
source = nil
level = .warning
case let decoding as DecodingError:
reason = "\(decoding)"
source = nil
level = .warning
case let localized as LocalizedError:
reason = localized.localizedDescription
source = nil
Expand Down

0 comments on commit 1baf623

Please sign in to comment.