diff options
| author | Teddy Wing | 2018-01-22 21:45:52 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-01-22 21:45:52 +0100 |
| commit | 45dde7e7dfc82cce180034533f89e931a42287e6 (patch) | |
| tree | d96bfed4ccf7ad95bf7925b8b02b525599e1541e | |
| parent | 54c921d24cb5759cc63f4781b8dc96fa389e5ef7 (diff) | |
| download | timetasker-45dde7e7dfc82cce180034533f89e931a42287e6.tar.bz2 | |
SubmitTimeEntry(): Log HTTP responseshow-http-response-when-time-emtry-submission-fails
The previous error message wasn't useful for determining the cause of
the error. It just said there was a problem, but provided no additional
information.
Append the HTTP response body from TimeTask to the error message so
users can see what they had a problem with.
| -rw-r--r-- | timetask/http.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/timetask/http.go b/timetask/http.go index f0a6548..7f5cc18 100644 --- a/timetask/http.go +++ b/timetask/http.go @@ -76,7 +76,7 @@ func SubmitTimeEntry(client http.Client, time_entry TimeEntry) error { string(body), "No time entries were created.", ) { - return fmt.Errorf("time entry creation failed") + return fmt.Errorf("time entry creation failed\nResponse: %s", body) } return nil |
