Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Improve error message thrown when path is not found #1014

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

lizkenyon
Copy link
Contributor

@lizkenyon lizkenyon commented Oct 13, 2023

Closes #989

WHY are these changes introduced?

We have seen multiple reports from users who do not know how to resolve the path not found error from the REST resources. This is often due to a required ID not being set.

WHAT is this pull request doing?

Improves the error message to print out potential matching URL paths.

Example error message now:

10:06:07 │ remix │ ERROR Discount RestResourceError: Could not find a path for request. If you are trying to make a request to one of the following paths, ensure all relevant IDs are set.
10:06:07 │ remix │  - price_rules/<price_rule_id>/discount_codes.json

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have used yarn changeset to create a draft changelog entry (do NOT update the CHANGELOG.md file manually)
  • I have added/updated tests for this change
  • [NA] I have documented new APIs/updated the documentation for modified APIs (for public APIs)

@lizkenyon lizkenyon requested a review from a team as a code owner October 13, 2023 20:05
Multiple reports of folks getting errors that they dont know how to resolve when missing IDs
@lizkenyon lizkenyon force-pushed the liz/throw-better-error-missing-ids branch from d49fb47 to b49820c Compare October 13, 2023 20:12
@lizkenyon lizkenyon merged commit b15942f into main Oct 23, 2023
@lizkenyon lizkenyon deleted the liz/throw-better-error-missing-ids branch October 23, 2023 15:05
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.

RestResourceError: Could not find a path for request
2 participants