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

ReactAsset improve error messages #421

Closed
wants to merge 4 commits into from

Conversation

cehan-Chloe
Copy link
Collaborator

@cehan-Chloe cehan-Chloe commented Jul 11, 2024

Issue: #376

Test result: https://app.buildbuddy.io/invocation/8eb077c0-1586-4699-b732-c92c332e7697

What's changed: improve error msg thrown by ReactAsset. more info and react-like errors
Before: if no matched asset found, throw error: No implementation found for id: bar-id type: bar
After:

  1. add check for no assets in registry
    image

  2. modify existing error msg for no match asset found
    image

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.76%. Comparing base (cd38fa1) to head (98e3d5c).

Additional details and impacted files
@@           Coverage Diff            @@
##           bazel-6     #421   +/-   ##
========================================
  Coverage    91.75%   91.76%           
========================================
  Files          339      339           
  Lines        27044    27068   +24     
  Branches      1962     1966    +4     
========================================
+ Hits         24814    24838   +24     
  Misses        2216     2216           
  Partials        14       14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cehan-Chloe cehan-Chloe changed the title WIP ReactAsset improve error messages ReactAsset improve error messages Jul 11, 2024
@cehan-Chloe cehan-Chloe marked this pull request as ready for review July 11, 2024 20:41
@@ -75,4 +75,9 @@ export class Registry<V> {
clear() {
this.store = createSortedArray<V>();
}

/** Check if the registry is empty*/
isRegistryEmpty() {
Copy link
Member

Choose a reason for hiding this comment

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

@sugarmanz @hborawski Do we expose the partial match registry on every platform(It doesn't look like we do but I just wanted to check)? If so we should also add this to every platforms API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines 69 to 71
`No implementation found for id: ${unwrapped.id} type: ${
unwrapped.type
}. This could happen for one of the following reasons: \n
Copy link
Member

Choose a reason for hiding this comment

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

Could we check for similarly named types and suggest alternatives?

No implementation found for type: "txt" did you mean "text"?

@cehan-Chloe cehan-Chloe force-pushed the react-asset-improve-err-msg branch from 2b24527 to 64d033b Compare July 12, 2024 14:06
@sugarmanz sugarmanz deleted the branch bazel-6 July 19, 2024 18:05
@sugarmanz sugarmanz closed this Jul 19, 2024
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.

5 participants