Unify error messages in http_client.go
@@ -32,7 +32,7 @@ func builtinHTTPClientInstanceMethods() []*BuiltinMethodObject {
resp, err := goClient.Get(u.value)
if err != nil {
- return t.vm.InitErrorObject(errors.HTTPError, sourceLine, "Could not complete request, %s", err)
+ return t.vm.InitErrorObject(errors.HTTPError, sourceLine, couldNotCompleteRequest, err)
}
gobyResp, err := responseGoToGoby(t, resp)
@@ -96,7 +96,7 @@ func builtinHTTPClientInstanceMethods() []*BuiltinMethodObject {
resp, err := goClient.Head(u.value)
if err != nil {
- return t.vm.InitErrorObject(errors.HTTPError, sourceLine, "Could not complete request, %s", err)
+ return t.vm.InitErrorObject(errors.HTTPError, sourceLine, couldNotCompleteRequest, err)
}
gobyResp, err := responseGoToGoby(t, resp)
@@ -133,7 +133,7 @@ func builtinHTTPClientInstanceMethods() []*BuiltinMethodObject {
goResp, err := goClient.Do(goReq)
if err != nil {
- return t.vm.InitErrorObject(errors.HTTPError, sourceLine, "Could not complete request, %s", err)
+ return t.vm.InitErrorObject(errors.HTTPError, sourceLine, couldNotCompleteRequest, err)
}
gobyResp, err := responseGoToGoby(t, goResp)
