Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Use context for error #168

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Use context for error #168

wants to merge 6 commits into from

Conversation

jkarni
Copy link
Member

@jkarni jkarni commented Aug 5, 2020

servant proper is moving towards using Context for errors, and that helps with servant-auth too (no need for e.g. throwAll, which doesn't work very well). This makes the error throw be in the context, so that handlers never see the error case.

@domenkozar
Copy link
Collaborator

What about situations where authentication is optional?

I have some endpoints that behave differently if auth is supplied.

@jkarni
Copy link
Member Author

jkarni commented Aug 12, 2021

What about situations where authentication is optional?

Would having it return e.g. a Maybe User instead of a User work?

@domenkozar
Copy link
Collaborator

Yeah!

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

Successfully merging this pull request may close these issues.

2 participants