Skip to content

Comments

Galley polysemy (4/5) - Error effects#1907

Merged
pcapriotti merged 10 commits intodevelopfrom
pcapriotti/galley-polysemy-errors
Nov 10, 2021
Merged

Galley polysemy (4/5) - Error effects#1907
pcapriotti merged 10 commits intodevelopfrom
pcapriotti/galley-polysemy-errors

Conversation

@pcapriotti
Copy link
Contributor

@pcapriotti pcapriotti commented Nov 3, 2021

This PR is about introducing Error effects in Galley, as part of the polysemy refactoring, and towards fixing https://wearezeta.atlassian.net/browse/FS-40.

The all-encompassing Wai.Error has now been split into several different error types, corresponding to some arbitrary error categories. The mapping between error categories and swagger error documentation is not yet established, and Servant integration is still missing.

Eventually, I would like to make the CanThrow combinator in Servant type-safe, by removing the most error effects from the list of errors that are accepted by the final Sem monad (AllErrorEffects in Galley.API.Error), and allowing use of CanThrow to "opt-in" to certain errors. Internal errors would still be handled by default.

This PR is still not addressing the main point of https://wearezeta.atlassian.net/browse/FS-40. That will be taken care of once the refactoring is finished.

Overall plan for the Polysemy refactoring of Galley

  1. Turn Galley into a newtype over Sem, and introduce "access" effects.
  2. Add "store" effects and convert Data code into interpretations.
  3. Turn placeholders into actual effects.
  4. Add fine-grained Error effects. (this pr)
  5. Make Galley into a type synonym over Sem, and get rid of Galley0.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • changelog.d contains the following bits of information:
    • A file with the changelog entry in one or more suitable sub-sections. The sub-sections are marked by directories inside changelog.d.

@pcapriotti pcapriotti changed the base branch from develop to pcapriotti/galley-store-effects2 November 3, 2021 12:36
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-store-effects2 branch from 4965697 to 9b65a81 Compare November 4, 2021 05:33
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-errors branch from 228b800 to c6c13e9 Compare November 4, 2021 07:03
@pcapriotti pcapriotti changed the title Galley polysemy (4/5) - Error effects Galley polysemy (4/5) - Error effects [skip ci] Nov 4, 2021
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-store-effects2 branch from 1446a25 to 539d109 Compare November 4, 2021 13:53
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-errors branch 2 times, most recently from 4ed6d20 to d10e4d7 Compare November 5, 2021 11:31
Base automatically changed from pcapriotti/galley-store-effects2 to develop November 5, 2021 12:26
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-errors branch from 0372e6c to 789ee79 Compare November 8, 2021 08:30
@pcapriotti pcapriotti force-pushed the pcapriotti/galley-polysemy-errors branch from 617a0c5 to febd7f7 Compare November 9, 2021 06:45
@pcapriotti pcapriotti changed the title Galley polysemy (4/5) - Error effects [skip ci] Galley polysemy (4/5) - Error effects Nov 9, 2021
@pcapriotti pcapriotti marked this pull request as ready for review November 9, 2021 06:51
Remove a commented out function signature
@pcapriotti pcapriotti merged commit 488f8b5 into develop Nov 10, 2021
@pcapriotti pcapriotti deleted the pcapriotti/galley-polysemy-errors branch November 10, 2021 05:49
@akshaymankar akshaymankar mentioned this pull request Nov 15, 2021
@smatting smatting mentioned this pull request Dec 2, 2021
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

Successfully merging this pull request may close these issues.

2 participants