Skip to content

Commit 3a4a6e7

Browse files
authored
chore: add upstream error type (#137)
1 parent a9788a3 commit 3a4a6e7

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

error_defaults.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,18 @@ var ErrConflict = DefaultError{
5959
}
6060

6161
var ErrMisconfiguration = DefaultError{
62-
IDField: "invalid_configuration",
63-
StatusField: http.StatusText(http.StatusInternalServerError),
64-
ErrorField: "Invalid configuration",
65-
ReasonField: "One or more configuration values are invalid. Please report this to the system administrator.",
66-
CodeField: http.StatusInternalServerError,
62+
IDField: "invalid_configuration",
63+
StatusField: http.StatusText(http.StatusInternalServerError),
64+
ErrorField: "Invalid configuration",
65+
ReasonField: "One or more configuration values are invalid. Please report this to the system administrator.",
66+
CodeField: http.StatusInternalServerError,
67+
GRPCCodeField: codes.Internal,
68+
}
69+
70+
var ErrUpstreamError = DefaultError{
71+
IDField: "upstream_error",
72+
StatusField: http.StatusText(http.StatusBadGateway),
73+
ErrorField: "Upstream error",
74+
ReasonField: "An upstream server encountered an error or returned a malformed or unexpected response.",
75+
CodeField: http.StatusBadGateway,
6776
}

0 commit comments

Comments
 (0)