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

fix: tag edge function signature errors as user errors #209

Merged
merged 3 commits into from
Nov 18, 2022

Conversation

jackiewmacharia
Copy link
Contributor

@jackiewmacharia jackiewmacharia commented Nov 18, 2022

🎉 Thanks for sending this pull request! 🎉

Please make sure the title is clear and descriptive.

Screenshot 2022-11-18 at 19 11 35

If you are fixing a typo or documentation, please skip these instructions.

Otherwise please fill in the sections below.

Which problem is this pull request solving?

Example: I'm always frustrated when [...]

List other issues or pull requests related to this problem

Example: This fixes #5012

Describe the solution you've chosen

Example: I've fixed this by [...]

Describe alternatives you've considered

Example: Another solution would be [...]

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • The status checks are successful (continuous integration). Those can be seen below.

A picture of a cute animal (not mandatory but encouraged)

@jackiewmacharia jackiewmacharia requested a review from a team November 18, 2022 16:10
node/config.ts Outdated
`Default export in '${func.path}' must be a function. More on the Edge Functions API at https://ntl.fyi/edge-api.`,
),
// empty string because it's not associated with a bundling format
{ format: '' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than specifying this, could we make the options parameter in wrapBundleError optional?

I would go as far as making the options parameter in the BundleError constructor itself optional, and I'd call it directly from here:

throw new BundleError(`Default export in '${func.path}' must be a function. More on the Edge Functions API at https://ntl.fyi/edge-api.`)

I think the purpose of wrapBundleError is to wrap something that may or may not be an error. In this case we know for a fact that we're dealing with an error because we're the ones creating it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackiewmacharia jackiewmacharia merged commit 5d5a50f into main Nov 18, 2022
@jackiewmacharia jackiewmacharia deleted the fix/tag-ef-signature-errors-as-user-errors branch November 18, 2022 16:48
Skn0tt pushed a commit to netlify/build that referenced this pull request Apr 23, 2024
…bundler#209)

* fix: tag edge function signature errors as user errors
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