Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-pinning-service-http-client
Commits
7ffc18b3
Unverified
Commit
7ffc18b3
authored
Dec 01, 2020
by
Marcin Rataj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: clean up error messages
this cleans up errors
parent
0b51d34f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
client.go
client.go
+3
-3
No files found.
client.go
View file @
7ffc18b3
...
@@ -395,13 +395,13 @@ func httperr(resp *http.Response, e error) error {
...
@@ -395,13 +395,13 @@ func httperr(resp *http.Response, e error) error {
if
ok
{
if
ok
{
ferr
,
ok
:=
oerr
.
Model
()
.
(
openapi
.
Failure
)
ferr
,
ok
:=
oerr
.
Model
()
.
(
openapi
.
Failure
)
if
ok
{
if
ok
{
return
errors
.
Wrapf
(
e
,
"statusCode: %d,
reason: %q, details: %q"
,
resp
.
StatusCode
,
ferr
.
Error
.
GetReason
(),
ferr
.
Error
.
GetDetails
())
return
errors
.
Wrapf
(
e
,
"
reason: %q, details: %q"
,
ferr
.
Error
.
GetReason
(),
ferr
.
Error
.
GetDetails
())
}
}
}
}
if
resp
==
nil
{
if
resp
==
nil
{
return
errors
.
Wrapf
(
e
,
"empty response from remote pinning service"
)
return
errors
.
Wrapf
(
e
,
"empty response from remote pinning service"
)
}
}
return
errors
.
Wrapf
(
e
,
"remote pinning service
error. statusCode:
%d"
,
resp
.
StatusCode
)
return
errors
.
Wrapf
(
e
,
"remote pinning service
returned http error
%d"
,
resp
.
StatusCode
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment