93
// status code based on the type of error.
94
// nolint:revive // Keeping all of the logic together for readability, even if it means the function is long.
95
>
func (h *BaseHTTPHandler) WriteFailure(writer http.ResponseWriter, r *http.Request, err error) {
server.go
96
>
var failure nexus.Failure
97
>
var failureError *nexus.FailureError
98
>
var opError *nexus.OperationError
99
>
var handlerError *nexus.HandlerError
100
>
var operationState nexus.OperationState
101
>
statusCode := http.StatusInternalServerError
102
>
103
>
if errors.As(err, &opError) {
104
operationState = opError.State
105
var convErr error