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

Enable coercion of trapped values #2024

Merged
merged 34 commits into from
Apr 29, 2024
Merged

Enable coercion of trapped values #2024

merged 34 commits into from
Apr 29, 2024

Conversation

benjie
Copy link
Member

@benjie benjie commented Apr 12, 2024

Description

trap($step, TRAP_ERROR, { valueForError: "NULL" | "EMPTY_LIST" | "PASS_THROUGH" })

When you trap an error or inhibited, you may want to have the value be replaced, either with NULL or EMPTY_LIST. Also, when trapping an error if you just keep it as an error it will immediately be turned back into an error again 🤦‍♂️ so we now wrap it in TrappedError (which does not inherit from Error and thus is treated as a value).

Performance impact

Unknown.

Security impact

None known.

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

Copy link

changeset-bot bot commented Apr 12, 2024

🦋 Changeset detected

Latest commit: 595fc08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
grafast Patch
@localrepo/grafast-bench Patch
@dataplan/json Patch
@dataplan/pg Patch
@grafserv/persisted Patch
grafserv Patch
ruru-components Patch
@localrepo/grafast-website Patch
graphile-build-pg Patch
graphile-build Patch
graphile-utils Patch
pgl Patch
postgraphile Patch
graphile-export Patch
graphile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benjie benjie marked this pull request as ready for review April 29, 2024 12:29
@benjie benjie merged commit dee8f5d into main Apr 29, 2024
24 checks passed
@benjie benjie deleted the trap-coalesce branch April 29, 2024 12:32
@benjie benjie mentioned this pull request May 10, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

1 participant