apiRequestError :: ApiRequestError -> Response
apiRequestError err = errorResponse status err
  where
    status =
      case err of
        ActionInappropriate -> HT.status405
        UnsupportedVerb -> HT.status405
        InvalidBody _ -> HT.status400
        ParseRequestError _ _ -> HT.status400
        NoRelationBetween _ _ -> HT.status400
        InvalidRange -> HT.status416
        UnknownRelation -> HT.status404
apiRequestError :: ApiRequestError -> Response
apiRequestError err = errorResponse status err
  where
    status =
      case err of
        ActionInappropriate -> HT.status405
        UnsupportedVerb -> HT.status405
        InvalidBody _ -> HT.status400
        ParseRequestError _ _ -> HT.status400
        NoRelationBetween _ _ -> HT.status400
        InvalidRange -> HT.status416
        UnknownRelation -> HT.status404
apiRequestError err = errorResponse status err
  where
    status =
      case err of
        ActionInappropriate -> HT.status405
        UnsupportedVerb -> HT.status405
        InvalidBody _ -> HT.status400
        ParseRequestError _ _ -> HT.status400
        NoRelationBetween _ _ -> HT.status400
        InvalidRange -> HT.status416
        UnknownRelation -> HT.status404