def METHOD_NAME(self, test, err):
    if isinstance(err[1], GradingComplete):
        # If grading stopped early, we will flag that but still loop through
        # the remaining cases so that we have the correct point values
        self.results[-1]["points"] = 0
        self.skip_grading = True
    elif isinstance(err[1], DoNotRun):
        self.results[-1]["points"] = 0
        self.results[-1]["max_points"] = 0
    elif isinstance(err[1], GradingSkipped):
        self.results[-1]["points"] = 0
        Feedback.set_name(test._testMethodName)
        Feedback.add_feedback(
            " - Grading was skipped because an earlier test failed - "
        )
    elif isinstance(err[1], UserCodeFailed):
        # Student code raised Exception
        tr_list = traceback.format_exception(*err[1].err)
        name = "Your code raised an Exception"
        self.done_grading = True
        if isinstance(err[1].err[1], SyntaxError) or isinstance(
            err[1].err[1], NameError
        ):
            self.grading_succeeded = False
            self.format_errors.append("Your code has a syntax error.")
            Feedback.set_main_output()
        else:
            self.results.append(
                {"name": name, "filename": "error", "max_points": 1, "points": 0}
            )
            Feedback.set_name("error")
        Feedback.add_feedback("".join(tr_list))
        Feedback.add_feedback("\n\nYour code:\n\n")
        print_student_code(
            st_code=Feedback.test.student_code_abs_path,
            ipynb_key=Feedback.test.ipynb_key,
        )
    else:
        tr_message = "".join(traceback.format_exception(*err))
        if isinstance(test, unittest.suite._ErrorHolder):
            # Error occurred outside of a test case, like in setup code for example
            # We can't really recover from this
            self.done_grading = True
            self.grading_succeeded = False
            self.results = [
                {
                    "name": "Internal Grading Error",
                    "filename": "error",
                    "max_points": 1,
                    "points": 0,
                }
            ]
            Feedback.set_name("error")
            Feedback.add_feedback(self.grader_error_message + tr_message)
        else:
            # Error in a single test -- keep going
            unittest.TestResult.METHOD_NAME(self, test, err)
            self.results[-1]["points"] = 0
            Feedback.add_feedback(self.error_message + tr_message)