ledger: wrap response errors with HTTP metadata#4
Conversation
|
Looks fine to me, @ilayaraja89 ? |
|
@sudhirj @adamdecaf Client applications might want to differentiate between 4xx and 5xx responses from Ledger. But now both are generalised as error, skipping the switch case of http status codes. https://github.com/RealImage/qledger-sdk-go/blob/master/transactions.go#L39 |
|
With Go's current error handling the best people can do is match on |
|
I think, in client applications, comparing against variables like Eg. https://github.com/RealImage/qledger-sdk-go/blob/master/transactions_test.go#L108 @adamdecaf Can you also check whether tests pass after this change ? |
|
They don't pass. This change would break the comparison you're talking about. I'm ok closing this change if it won't work. |
I found enhancing the error helps to debug problems. I don't consider the URL (i.e. account ID) sensitive since it would end up in load balancer logs.