distinguish ERROR(ybc) from ERROR(other)

refactored handle_exception for this
handle_exception: refactor `error_kind` into `phase`