[FIX] incorrect error toast messages
Proposed changes (including videos or screenshots)
Issue(s)
https://open.rocket.chat/channel/rocketchat-dev?msg=NHaMAkZDYssEEBZW4
Steps to test or reproduce
Further comments
useEndpoint throws an object that doesn't implement toString which is causing String(error) to resolve to [object Object] even though the object contains the error property. On the other hand handleError checks for both message and error properties along with doing other things (and now defaults to a string conversion) so there is no need to check type on runtime and cast for each instance manually.
ignore the very incorrect branch name 🙈
Codecov Report
Merging #26320 (d117667) into develop (49fa71a) will increase coverage by
0.13%. The diff coverage is5.98%.
@@ Coverage Diff @@
## develop #26320 +/- ##
===========================================
+ Coverage 38.51% 38.65% +0.13%
===========================================
Files 758 758
Lines 18818 18820 +2
Branches 1461 1452 -9
===========================================
+ Hits 7247 7274 +27
+ Misses 11354 11328 -26
- Partials 217 218 +1
| Flag | Coverage Δ | |
|---|---|---|
| e2e | 38.65% <5.98%> (+0.13%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
This pull request introduces 1 alert when merging 11d3ffed56486162959d3c07fc8ecc9193a2ea25 into 50af9b29e463b8eecc8e06cb51d0a26a0b0936aa - view on LGTM.com
new alerts:
- 1 for Comparison between inconvertible types