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

dapp: Fix non-informative error message on SDK's wrapped errors #1765

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

andrevmatos
Copy link
Contributor

Thank you for submitting this pull request :)

Fixes #1756

Short description
Wrapping errors as previously done on the RaidenService doesn't work, since passing Error objects to an Error constructur gets it serialized as unhelpful "[object Object]" string.
This fixes the error by exposing the original instance, as expected by ErrorMessage.vue component. If it's a known error, expected message is shown. Otherwise, the much more informative original message is shown.

Definition of Done

  • Steps to manually test the change have been documented
  • Acceptance criteria are met
  • Change has been manually tested by the reviewer (dApp)

Steps to manually test the change (dApp)

  1. Try to trigger the bug, as described

@andrevmatos andrevmatos requested a review from taleldayekh June 22, 2020 22:17
@andrevmatos andrevmatos self-assigned this Jun 22, 2020
@codecov
Copy link

codecov bot commented Jun 22, 2020

Codecov Report

Merging #1765 into master will decrease coverage by 0.00%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1765      +/-   ##
==========================================
- Coverage   95.30%   95.29%   -0.01%     
==========================================
  Files         148      148              
  Lines        5328     5318      -10     
  Branches     1022      964      -58     
==========================================
- Hits         5078     5068      -10     
  Misses        203      203              
  Partials       47       47              
Flag Coverage Δ
#dapp 91.43% <85.71%> (-0.06%) ⬇️
#sdk 96.85% <ø> (ø)
Impacted Files Coverage Δ
raiden-dapp/src/services/raiden-service.ts 88.11% <85.71%> (-0.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 300a654...5b7ca2e. Read the comment docs.

Copy link
Contributor

@kelsos kelsos left a comment

Choose a reason for hiding this comment

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

Lovely, thank you for doing this. Now that we have proper errors it makes sense to remove the unneeded wrapping.

@andrevmatos andrevmatos merged commit 7e770c8 into master Jun 23, 2020
@andrevmatos andrevmatos deleted the fix/dapp_service_error branch June 23, 2020 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid error message on open channel
2 participants