You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have error middleware in place so that my API gets properly formatted errors. When trying to conform the StripeError to AbortError, the responses are still in the format of StripeErrors. Any insight on this?
I tried the following:
extension StripeError: AbortError {
public var status: HTTPResponseStatus {
return .badRequest
}
public var reason: String {
return "because it failed..."
}
}
For some reason, I'm also getting status code 200 for errors..
The text was updated successfully, but these errors were encountered:
After talking to the vapor folks.. StripeError is conforming to ResponseEncodable and as of Vapor 3.3.0 this will by default return the StripeError and not my custom implementation.
To fix this.. we need to make the StripeError either not conform to ResponseEncodable or to make it properly format the response (this should be user configurable)
One option would be to make StripeAPIError conform to only Decodable and not to Codable. I did that on my end and it fixed it for me.
I have error middleware in place so that my API gets properly formatted errors. When trying to conform the StripeError to AbortError, the responses are still in the format of StripeErrors. Any insight on this?
I tried the following:
For some reason, I'm also getting status code 200 for errors..
The text was updated successfully, but these errors were encountered: