Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

[FIX] incorrect error toast messages

Open debdutdeb opened this issue 3 years ago • 1 comments

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.

debdutdeb avatar Jul 20 '22 17:07 debdutdeb

ignore the very incorrect branch name 🙈

debdutdeb avatar Jul 20 '22 17:07 debdutdeb

Codecov Report

Merging #26320 (d117667) into develop (49fa71a) will increase coverage by 0.13%. The diff coverage is 5.98%.

Impacted file tree graph

@@             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.

codecov[bot] avatar Aug 10 '22 12:08 codecov[bot]

This pull request introduces 1 alert when merging 11d3ffed56486162959d3c07fc8ecc9193a2ea25 into 50af9b29e463b8eecc8e06cb51d0a26a0b0936aa - view on LGTM.com

new alerts:

  • 1 for Comparison between inconvertible types

lgtm-com[bot] avatar Aug 12 '22 04:08 lgtm-com[bot]