set_report_max_quit_count( 10 );
It will exit simulation after the number of UVM_ERRORS reaching 10.
It can be added in build_phase or other phases.
It can be added in base_test. If you add it in testcase at the same time, testcase would be given the highest priority.
You can also use below option to enable this feature when do simulation:
+UVM_MAX_QUIT_COUNT=10
Normally, we should set this to terminated simulation early since we have already get enough UVM_ERROR message to debug.