You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returning promises from a try block without awaiting won't actually catch errors associated with the rejection of said Promise.
asyncfunctionthrowsError(){throw"Some error that was thrown.";}asyncfunctionmain(){constappEl=document.getElementById("app");try{awaitthrowsError();}catch(err){// This works since the rejected Promise is awaitedappEl.innerHTML="Error A";}try{throwsError();}catch(err){// This won't catch since the Promise is resolved after the try / catch has been runappEl.innerHTML="Error B";}}main();
Returning promises from a
try
block without awaiting won't actually catch errors associated with the rejection of said Promise.There is an eslint rule that can guard against this issue:
https://typescript-eslint.io/rules/return-await/
We should enable it, and fix any offending code. Running this on
web-client-ui
, I currently see 2 offending places:packages/iris-grid/src/IrisGridTableModelTemplate.ts
valuesTable
packages/utils/src/ClipboardUtils.ts
copyToClipboard
The text was updated successfully, but these errors were encountered: