diff --git a/webapi/errors.go b/webapi/errors.go index eca944d..bf334e5 100644 --- a/webapi/errors.go +++ b/webapi/errors.go @@ -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" } diff --git a/webapi/payfee.go b/webapi/payfee.go index b01a50c..ef6bdf0 100644 --- a/webapi/payfee.go +++ b/webapi/payfee.go @@ -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 }