We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 360f166 commit 3441869Copy full SHA for 3441869
protocol/lighter/api.go
@@ -59,12 +59,18 @@ func (tx *LighterTx) UnmarshalJSON(data []byte) error {
59
return err
60
}
61
62
+ if tx.Code != 200 {
63
+ return fmt.Errorf("lighter error: code %d, message: %s", tx.Code, tx.Info)
64
+ }
65
+
66
if tx.Type == TxTypeL2Transfer {
67
var t *Transfer
68
if err := json.Unmarshal([]byte(tx.Info), &t); err != nil {
- return err
69
+ return fmt.Errorf("failed to unmarshal transfer: %w", err)
70
71
tx.Transfer = t
72
+ } else {
73
+ return fmt.Errorf("invalid transaction type: %d", tx.Type)
74
75
76
return nil
0 commit comments