Skip to content

Extremely lazy error handling #3

@ctrlcctrlv

Description

@ctrlcctrlv

import Web.Scotty

import qualified Data.ByteString as B hiding (unpack, pack)

alacrity/src/Helpers.hs

Lines 130 to 135 in 37aebe4

rawData :: ServerOut -> (B.ByteString, Status)
rawData !(ErrorMsg !s) = case s of
"e0001" -> (B.pack s, notFound404)
"e0002" -> (B.pack s, badRequest400)
"e0003" -> (B.pack s, unprocessable422)
"e0004" -> (B.pack s, notImplemented501)

An advanced framework is in use, scotty.

It's clear that alacritty will never be used outside of a web server context.

Why then can it still, five years later, not serve any error page more complicated than "e0001" served with Content-Type text/html?

Are users really expected to know how to find the § Error codes, much less interpret them?

You've denigrated my code quality in a documentary, so I denigrate yours. This error handling sucks. At least I've improved in five years, one of my fonts even appears in the intro of the documentary. Such can not be said of "e0001". 😜

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions