catch some runtime errors in current context