Try to capture more data on the failure to create address with Lob

This commit is contained in:
Eli Ribble 2026-04-17 20:50:43 +00:00
parent 0420b777c9
commit cedbb3372e
No known key found for this signature in database

View file

@ -123,7 +123,11 @@ func (l *Lob) AddressCreate(ctx context.Context, req RequestAddressCreate) (Addr
return result, fmt.Errorf("address list post: %w", err)
}
if !resp.IsSuccess() {
return result, fmt.Errorf("not successful")
content, err := io.ReadAll(resp.Body)
if err != nil {
return result, fmt.Errorf("not successful, and can't read response body")
}
return result, fmt.Errorf("not successful: %s", string(content))
}
return result, nil
}