We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2e227d commit c7564bcCopy full SHA for c7564bc
solga/src/Solga.hs
@@ -41,6 +41,7 @@ module Solga
41
-- * Error handling
42
, SolgaError
43
, badRequest
44
+ , unauthorized
45
, notFound
46
, internalServerError
47
-- * Router implementation
@@ -366,6 +367,13 @@ badRequest msg = SolgaError
366
367
, errorMessage = msg
368
}
369
370
+-- | Create a @401 Unauthorized@ error with a given message.
371
+unauthorized :: Text.Text -> SolgaError
372
+unauthorized msg = SolgaError
373
+ { errorStatus = HTTP.unauthorized401
374
+ , errorMessage = msg
375
+ }
376
+
377
-- | Create a @404 Not Found@ error with a given message.
378
notFound :: Text.Text -> SolgaError
379
notFound msg = SolgaError
0 commit comments