svn_error_t * svn_error_abort_on_malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr) { svn_error_t *err = svn_error_raise_on_malfunction(TRUE, file, line, expr); svn_handle_error2(err, stderr, FALSE, "svn: "); abort(); return err; /* Not reached. */ }
svn_error_t * svn_error_handle_malfunction(svn_boolean_t can_return, const char *file, int line, const char *expr) { // we get here every time Subversion encounters something very unexpected. svn_error_t * err = svn_error_raise_on_malfunction(TRUE, file, line, expr); if (err) { svn_error_t * errtemp = err; do { OutputDebugStringA(errtemp->message); OutputDebugStringA("\n"); } while ((errtemp = errtemp->child) != NULL); if (can_return) return err; if (CRegDWORD(L"Software\\TortoiseSVN\\Debug", FALSE)==FALSE) { CCrashReport::Instance().Uninstall(); CAutoWriteWeakLock writeLock(CSVNStatusCache::Instance().GetGuard(), 5000); bRun = false; CSVNStatusCache::Instance().Stop(); abort(); // ugly, ugly! But at least we showed a messagebox first } } CStringA sFormatErr; sFormatErr.Format("Subversion error in TSVNCache: file %s, line %ld, error %s\n", file, line, expr); OutputDebugStringA(sFormatErr); if (CRegDWORD(L"Software\\TortoiseSVN\\Debug", FALSE)==FALSE) { CCrashReport::Instance().Uninstall(); CAutoWriteWeakLock writeLock(CSVNStatusCache::Instance().GetGuard(), 5000); bRun = false; CSVNStatusCache::Instance().Stop(); abort(); // ugly, ugly! But at least we showed a messagebox first } return NULL; // never reached, only to silence compiler warning }