From 45dde7e7dfc82cce180034533f89e931a42287e6 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 22 Jan 2018 21:45:52 +0100 Subject: SubmitTimeEntry(): Log HTTP response 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. --- timetask/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'timetask') 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 -- cgit v1.2.3