refactored contenxt_type into _get_base_error_context