-
Notifications
You must be signed in to change notification settings - Fork 352
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(command-deploy): handle deploy error when there are no files to deploy #1274
Conversation
} catch (e) { | ||
warn(`Failed canceling deploy with id ${deployId}: ${e.message}`) | ||
} | ||
await cancelDeploy({ api, deployId, warn }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can throw an error and let the calling function cancel the deploy, but we would need lift the spinner handling too.
@@ -220,6 +222,9 @@ const runDeploy = async ({ | |||
filter: getDeployFilesFilter({ site, deployFolder }), | |||
}) | |||
} catch (e) { | |||
if (deployId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[sand] Should this be put inside an additional try
/catch
inner block around deployEdgeHandlers()
+ api.deploy()
instead? Like this, there would be no need to check if deployId
exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would mean we need to re-throw the error after canceling the deploy to reach the other part of the error handling code (we could also refactor that part when we do netlify/js-client#157 to have a dedicated try/catch
per operation to have better error reporting).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to merge and release. We can discuss this in netlify/js-client#157
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
- Summary
Fixes #1227
Dependant on netlify/js-client#161
Handles the error thrown by
js-client
when there are no files to deploy (cancels the created deploy).- Test plan
Will push a test once is netlify/js-client#161 merged and published
- Description for the changelog
Handle deploy error when there are no files to deploy
- A picture of a cute animal (not mandatory but encouraged)
🐳