Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Gracefully handle errors validating the form #1751

Merged
merged 5 commits into from
Nov 16, 2021
Merged

Gracefully handle errors validating the form #1751

merged 5 commits into from
Nov 16, 2021

Conversation

pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Nov 15, 2021

Fixes: Bugsnag error
Fixes: Bugsnag error

WHY are these changes introduced?

After releasing 2.7.0 I noticed a new error in the app creation flow. After digging into it, I realized we are rescueing from from validation errors and returning a nil. Because we try to call a method on that returned nil value, the execution terminates.

WHAT is this pull request doing?

I changed the node_service to follow the same approach as the rails_service. If the output from the form is nil, we return printing the help to the user.

How to test your changes?

Try to create an app (e.g. shopify node create)

Update checklist

  • I've added a CHANGELOG entry for this PR (if the change is public-facing)
  • I've considered possible cross-platform impacts (Mac, Linux, Windows).
  • I've left the version number as is (we'll handle incrementing this when releasing).
  • I've included any post-release steps in the section above.

@pepicrft pepicrft requested a review from a team November 15, 2021 15:04
@pepicrft pepicrft self-assigned this Nov 15, 2021
@pepicrft pepicrft requested review from jesalerno84 and gonzaloriestra and removed request for a team November 15, 2021 15:04
@pepicrft pepicrft requested a review from a team November 15, 2021 15:05
@pepicrft pepicrft changed the title Don't rescue from abort returning nil Gracefully handle errors validating the form Nov 15, 2021
Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

🎩 ✔️

@pepicrft pepicrft merged commit d1e894d into main Nov 16, 2021
@pepicrft pepicrft deleted the raise-abort branch November 16, 2021 15:35
@gonzaloriestra gonzaloriestra mentioned this pull request Nov 17, 2021
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems November 17, 2021 13:22 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants