File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,24 @@ const (
33
33
HeaderMacaroon = "Macaroon"
34
34
)
35
35
36
+ // proxyErr is an error type that adds more context to an error occurring in the
37
+ // proxy.
38
+ type proxyErr struct {
39
+ wrapped error
40
+ proxyContext string
41
+ }
42
+
43
+ // Error returns the error message as a string, including the proxy's context.
44
+ func (e * proxyErr ) Error () string {
45
+ return fmt .Sprintf ("proxy error with context %s: %v" , e .proxyContext ,
46
+ e .wrapped )
47
+ }
48
+
49
+ // Unwrap returns the wrapped error.
50
+ func (e * proxyErr ) Unwrap () error {
51
+ return e .wrapped
52
+ }
53
+
36
54
// newRpcProxy creates a new RPC proxy that can take any native gRPC, grpc-web
37
55
// or REST request and delegate (and convert if necessary) it to the correct
38
56
// component.
You can’t perform that action at this time.
0 commit comments