def METHOD_NAME(self):
    src_error_file = os.path.join(self.test_dir, "src_error.json")
    eh = ErrorHandler()
    with patch.dict(os.environ, {"TORCHELASTIC_ERROR_FILE": src_error_file}):
        eh.record_exception(RuntimeError("foobar"))
    with patch.dict(os.environ, {"TORCHELASTIC_ERROR_FILE": self.test_error_file}):
        eh.dump_error_file(src_error_file)
        self.assertTrue(filecmp.cmp(src_error_file, self.test_error_file))
    with patch.dict(os.environ, {}):
        eh.dump_error_file(src_error_file)
        # just validate that dump_error_file works when
        # my error file is not set
        # should just log an error with src_error_file pretty printed