Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely lazy error handling #3

Open
ctrlcctrlv opened this issue Mar 31, 2021 · 0 comments
Open

Extremely lazy error handling #3

ctrlcctrlv opened this issue Mar 31, 2021 · 0 comments

Comments

@ctrlcctrlv
Copy link

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". 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant