Using type as unknown should work
Use the below snippet as example
try{
//your code
}catch(e : unknown ){
if( e instanceof Error){
setErrormessage(e.message)
}
}