File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -381,8 +381,8 @@ func (p *Parser) render() {
381
381
Return (Nil (), Id ("e" )),
382
382
).Else ().If ().Id ("e" ).Op (":=" ).Qual ("encoding/json" , "Unmarshal" ).Call (Id ("m" ).Dot ("Data" ), Op ("&" ).Id ("r" )).Op (";" ).Id ("e" ).Op ("!=" ).Nil ().Block (
383
383
Return (Nil (), Id ("e" )),
384
- ).Else ().If ().Id ("r" ).Dot ("Error" ).Op ("!=" ).Nil ( ).Block (
385
- Return (Nil (), Id ("r" ).Dot ("Error" )),
384
+ ).Else ().If ().Id ("r" ).Dot ("Error" ).Op ("!=" ).Lit ( "" ).Block (
385
+ Return (Nil (), Qual ( "errors" , "New" ). Call ( Id ("r" ).Dot ("Error" ) )),
386
386
).Else ().Block (
387
387
Return (Id ("r" ).Dot ("Data" ), Nil ()),
388
388
),
@@ -534,7 +534,7 @@ func (p *Parser) render() {
534
534
}
535
535
536
536
it .Op (";" ).Id ("err" ).Op ("!=" ).Nil ().Block (
537
- Id ("r" ).Dot ("Error" ).Op ("=" ).Id ("err" ),
537
+ Id ("r" ).Dot ("Error" ).Op ("=" ).Id ("err" ). Dot ( "Error" ). Call () ,
538
538
)
539
539
540
540
if len (m .Results ) > 1 {
Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ type Logger interface {
9
9
type Request struct {
10
10
Subject string `json:"-"` // nats subject, used for processing only and not sent via nats
11
11
Data []byte `json:"d,omitempty"` // params (on server) or result (on client)
12
- Error error `json:"e,omitempty"` // error sent from server handler
12
+ Error string `json:"e,omitempty"` // error sent from server handler
13
13
}
You can’t perform that action at this time.
0 commit comments