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

Move parse + typecheck failures from LoadingFailure to SystemFailure #2323

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented Feb 10, 2025

Two constructors in LoadingFailure represented failures that are not necessarily limited to failures that can only happen when loading an asset, namely, parsing failures and typechecking failures. For example, we could fail to parse or typecheck a term entered at the REPL, which has nothing to do with loading an asset. This PR:

  1. Moves those constructors into SystemFailure.
  2. Adds a way to embed any SystemFailure into a LoadingFailure (via the new General constructor; name bikeshedding welcome)
  3. Removes the CustomMessage constructor from LoadingFailure since now that can be achieved via General . CustomFailure.

This is a preliminary refactoring moving towards a PR for #495.

@byorgey byorgey requested review from kostmo and xsebek February 10, 2025 02:46
@xsebek
Copy link
Member

xsebek commented Feb 10, 2025

Regarding General, how about:

  • Failure
  • SystemFailure (the constructor name is free it seems?)
  • OtherFailure

@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label Feb 11, 2025
@mergify mergify bot merged commit c036342 into main Feb 11, 2025
12 checks passed
@mergify mergify bot deleted the refactor/byorgey/failure branch February 11, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants