File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2024 Blink Labs Software
1+ // Copyright 2025 Blink Labs Software
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1515package api
1616
1717import (
18+ "errors"
1819 "fmt"
1920 "io"
2021
@@ -83,8 +84,12 @@ func handleLocalSubmitTx(c *gin.Context) {
8384 txHash , err := submit .SubmitTx (submitConfig , txRawBytes )
8485 if err != nil {
8586 if c .GetHeader ("Accept" ) == "application/cbor" {
86- txRejectErr := err .(localtxsubmission.TransactionRejectedError )
87- c .Data (400 , "application/cbor" , txRejectErr .ReasonCbor )
87+ var txRejectErr * localtxsubmission.TransactionRejectedError
88+ if errors .As (err , & txRejectErr ) {
89+ c .Data (400 , "application/cbor" , txRejectErr .ReasonCbor )
90+ } else {
91+ c .Data (500 , "application/cbor" , []byte {})
92+ }
8893 } else {
8994 if err .Error () != "" {
9095 c .JSON (400 , err .Error ())
You can’t perform that action at this time.
0 commit comments