github vapor/vapor 4.77.1
Improve error reporting for `EncodingError` and `DecodingError`

latest releases: 4.105.2, 4.105.1, 4.105.0...
14 months ago
This patch was authored by @grahamburgsma and released by @0xTim.

As EncodingError and DecodingError both conform to LocalizedError, error reporting uses their localizedDescription which is just a generic error message.

So this changes the error reporting from:

The operation could not be completed. The data isn’t in the correct format.

To a description much more useful (for example):

invalidValue(inf, Swift.EncodingError.Context(codingPath: [...], debugDescription: "Unable to encode Double.inf directly in JSON.", underlyingError: nil))

Don't miss a new vapor release

NewReleases is sending notifications on new releases.