fix: extend error handling; bump: nats.go v1.13.0

This commit is contained in:
jar3b@outlook.com
2021-10-11 18:44:22 +03:00
parent ca5a582074
commit cbf1bd1b26
4 changed files with 12 additions and 9 deletions

View File

@@ -46,7 +46,7 @@ func (nt NatsTransport) RoundTrip(r *http.Request) (*http.Response, error) {
// Serialize the request.
requestBytes, err := proto.Marshal(request)
if err != nil {
return nil, fmt.Errorf("nats_transport: cannot serialize request")
return nil, fmt.Errorf("nats_transport: cannot serialize request: %v", err)
}
// get the outgoing NATS subject
@@ -65,7 +65,7 @@ func (nt NatsTransport) RoundTrip(r *http.Request) (*http.Response, error) {
nt.Timeout,
)
if err != nil {
return nil, fmt.Errorf("nats_transport: cannot send NATS request")
return nil, fmt.Errorf("nats_transport: cannot send NATS request: %v", err)
}
// Get Response object from NATS message