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