Skip to content
This repository was archived by the owner on May 2, 2022. It is now read-only.

Conversation

@ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Sep 25, 2020

Fixes #69.

If a Edge handler source file has a syntax error, Rollup will fail.
This should be handled and reported as a user error (using utils.build.failBuild()) instead of a plugin error.

@ehmicky ehmicky added the type: bug code to address defects in shipped code label Sep 25, 2020
@ehmicky ehmicky self-assigned this Sep 25, 2020
@ehmicky ehmicky mentioned this pull request Sep 25, 2020
});
return code;
} catch (error) {
return utils.build.failBuild("Error while bundling Edge handlers", { error });
Copy link
Contributor

Choose a reason for hiding this comment

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

will this still throw? what will the return value of the function become? don't we have to cancel upstream steps somehow?

Copy link
Contributor Author

@ehmicky ehmicky Sep 25, 2020

Choose a reason for hiding this comment

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

From a plugin authoring standpoint, the execution will stop right there. The return is actually not needed (and it could be removed).
The way this is implemented under the hood is by throwing an error.

Rollup should stop since it just failed. Also, uploading has not started yet. The build will stop, which should prevent anything else to be run. Is there something specific you had in mind that should be cancelled?

Copy link
Contributor

Choose a reason for hiding this comment

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

i just wanted to make sure we don't continue uploading empty code when returning here

Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment that calling this actually throws and thereby stops execution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just did 👍

@ehmicky ehmicky force-pushed the bug/error-handle-rollup branch from b58acec to 7bcf5b0 Compare September 25, 2020 16:15
@ehmicky ehmicky requested a review from mraerino September 25, 2020 16:52
@ehmicky ehmicky merged commit 6315e10 into master Sep 25, 2020
@ehmicky ehmicky deleted the bug/error-handle-rollup branch September 25, 2020 17:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type: bug code to address defects in shipped code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle Rollup errors

3 participants