Unique error for fee broadcast failure
This commit is contained in:
parent
8c428c769d
commit
5a8bc49c22
@ -24,6 +24,7 @@ const (
|
||||
errFeeNotReceived
|
||||
errInvalidTicket
|
||||
errCannotBroadcastTicket
|
||||
errCannotBroadcastFee
|
||||
)
|
||||
|
||||
// httpStatus maps application error codes to HTTP status codes.
|
||||
@ -59,6 +60,8 @@ func (e apiError) httpStatus() int {
|
||||
return http.StatusBadRequest
|
||||
case errCannotBroadcastTicket:
|
||||
return http.StatusInternalServerError
|
||||
case errCannotBroadcastFee:
|
||||
return http.StatusInternalServerError
|
||||
default:
|
||||
return http.StatusInternalServerError
|
||||
}
|
||||
@ -97,6 +100,8 @@ func (e apiError) defaultMessage() string {
|
||||
return "not a valid ticket tx"
|
||||
case errCannotBroadcastTicket:
|
||||
return "ticket transaction could not be broadcast"
|
||||
case errCannotBroadcastFee:
|
||||
return "fee transaction could not be broadcast"
|
||||
default:
|
||||
return "unknown error"
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ findAddress:
|
||||
funcName, ticket.Hash, err)
|
||||
}
|
||||
|
||||
sendErrorWithMsg("could not broadcast fee transaction", errInvalidFeeTx, c)
|
||||
sendErrorWithMsg("could not broadcast fee transaction", errCannotBroadcastFee, c)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user