* always restore the previous error handler * throw `LogicExcetion` when unexpected error type is triggered