Skip to content

Commit 4ec02f2

Browse files
committed
Add 403 Forbidden.
1 parent c7564bc commit 4ec02f2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

solga/src/Solga.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module Solga
4242
, SolgaError
4343
, badRequest
4444
, unauthorized
45+
, forbidden
4546
, notFound
4647
, internalServerError
4748
-- * Router implementation
@@ -374,6 +375,13 @@ unauthorized msg = SolgaError
374375
, errorMessage = msg
375376
}
376377

378+
-- | Create a @403 Forbidden@ error with a given message.
379+
forbidden :: Text.Text -> SolgaError
380+
forbidden msg = SolgaError
381+
{ errorStatus = HTTP.forbidden403
382+
, errorMessage = msg
383+
}
384+
377385
-- | Create a @404 Not Found@ error with a given message.
378386
notFound :: Text.Text -> SolgaError
379387
notFound msg = SolgaError

0 commit comments

Comments
 (0)