Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
a9e5e59d
Commit
a9e5e59d
authored
May 05, 2020
by
Geoff Simmons
Committed by
Tim Leers
Jul 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error messages derived from the dataplane API.
parent
f718f448
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
dataplane.go
pkg/haproxy/dataplane.go
+22
-1
No files found.
pkg/haproxy/dataplane.go
View file @
a9e5e59d
...
...
@@ -35,6 +35,7 @@ import (
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/go-openapi/strfmt"
...
...
@@ -108,7 +109,27 @@ type DataplaneError struct {
}
func
(
err
*
DataplaneError
)
Error
()
string
{
return
*
err
.
Err
.
Message
var
sb
strings
.
Builder
sb
.
WriteString
(
http
.
StatusText
(
err
.
Status
))
sb
.
WriteString
(
" ("
)
sb
.
WriteString
(
strconv
.
Itoa
(
err
.
Status
))
sb
.
WriteString
(
") version="
)
sb
.
WriteString
(
strconv
.
Itoa
(
err
.
Version
))
if
err
.
Err
.
Code
!=
nil
{
sb
.
WriteString
(
" models.Error.Code="
)
sb
.
WriteString
(
strconv
.
Itoa
(
int
(
*
err
.
Err
.
Code
)))
}
for
k
,
v
:=
range
err
.
Err
.
Error
{
sb
.
WriteRune
(
' '
)
sb
.
WriteString
(
k
)
sb
.
WriteRune
(
'='
)
sb
.
WriteString
(
v
)
}
if
err
.
Err
.
Message
!=
nil
{
sb
.
WriteString
(
": "
)
sb
.
WriteString
(
*
err
.
Err
.
Message
)
}
return
sb
.
String
()
}
type
DataplaneClient
struct
{
...
...
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