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
I noticed that when I want to catch an error and identify it using instanceof I got an error TypeError: Right-hand side of 'instanceof' is not an object. Which was caused by following code:
import{PostgresError}from'postgres';try{// await query}catch(e){if(einstanceofPostgresError){// do something}}
To fix that I had to use default import:
importPostgresfrom'postgres';try{// await query}catch(e){if(einstanceofPostgres.PostgresError){// do something}}
This is confusing because typescript was not able to catch the failing example as something wrong and I was able to find this error only in runtime.
josh-i386g, risk1996, nathankleyn, gaborcs and zachstence