Well if know where you'd expect an error you can just do a check to see if that error occured and just pop up a message.
If you think a surface might not exist, check for a surface and if none is there pop up the error.
If you think a number might be divided by 0, then check for 0 and if so throw the error.
Of course you can't just have it be a generic "if any error happens" but that's the case even with try catch statements.