STDMETHODIMP ProgressWrap::COMGETTER(ErrorInfo)(IVirtualBoxErrorInfo **aErrorInfo) { LogRelFlow(("{%p} %s: enter aErrorInfo=%p\n", this, "Progress::getErrorInfo", aErrorInfo)); VirtualBoxBase::clearError(); HRESULT hrc; try { CheckComArgOutPointerValidThrow(aErrorInfo); AutoCaller autoCaller(this); if (FAILED(autoCaller.rc())) throw autoCaller.rc(); hrc = getErrorInfo(ComTypeOutConverter<IVirtualBoxErrorInfo>(aErrorInfo).ptr()); } catch (HRESULT hrc2) { hrc = hrc2; } catch (...) { hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); } LogRelFlow(("{%p} %s: leave *aErrorInfo=%p hrc=%Rhrc\n", this, "Progress::getErrorInfo", *aErrorInfo, hrc)); return hrc; }
void CVodesIntegrator::integrate(double tout) { int flag = CVode(m_cvode_mem, tout, m_y, &m_time, CV_NORMAL); if (flag != CV_SUCCESS) { throw CVodesErr("CVodes error encountered. Error code: " + int2str(flag) + "\n" + m_error_message + "\nComponents with largest weighted error estimates:\n" + getErrorInfo(10)); } m_sens_ok = false; }
//-------------------------------------------------- // displays program name and final error code // list any other errors //-------------------------------------------------- void listStatus(const char* prog, int err) { fprintf(stdout, "%s - RC: %d\n", prog, err); while(hasUnreadErrors()) { ErrorInfo* pErr = getErrorInfo(); char* pErrStr = getErrorString(pErr->code); fprintf(stdout, "ERROR: %d - %s - %s\n", pErr->code, pErrStr, pErr->assertion); } }
double CVodesIntegrator::step(double tout) { int flag = CVode(m_cvode_mem, tout, m_y, &m_time, CV_ONE_STEP); if (flag != CV_SUCCESS) { throw CanteraError("CVodesIntegrator::step", "CVodes error encountered. Error code: {}\n{}\n" "Components with largest weighted error estimates:\n{}", flag, m_error_message, getErrorInfo(10)); } m_sens_ok = false; return m_time; }
//-------------------------------------------------- // Checks DigiDoc library internal errors //-------------------------------------------------- EXP_OPTION int checkDigiDocErrors() { char *errorClass[] = {"NO_ERRORS", "TECHNICAL", "USER", "LIBRARY"}; int err = ERR_OK; while(hasUnreadErrors()) { ErrorInfo* pErr = getErrorInfo(); char* pErrStr = getErrorString(pErr->code); printf("Error: %d - %s; file: %s line: %d; failed condition: %s, error class : %s\n", pErr->code, pErrStr, pErr->fileName, pErr->line, pErr->assertion, errorClass[getErrorClass(pErr->code)]); err = pErr->code; } clearErrors(); return err; }
void CVodesIntegrator::integrate(double tout) { if (tout == m_time) { return; } int flag = CVode(m_cvode_mem, tout, m_y, &m_time, CV_NORMAL); if (flag != CV_SUCCESS) { throw CanteraError("CVodesIntegrator::integrate", "CVodes error encountered. Error code: {}\n{}\n" "Components with largest weighted error estimates:\n{}", flag, m_error_message, getErrorInfo(10)); } m_sens_ok = false; }
static void Test(int use_threads, int return_data) { tds_thread wait_thread; #if !HAVE_ALARM if (!use_threads) return; #endif printf("testing with %s\n", use_threads ? "threads" : "signals"); printf(">> Wait 5 minutes...\n"); if (!use_threads) { alarm(4); signal(SIGALRM, sigalrm_handler); } else { int err; exit_thread = 0; err = tds_thread_create(&wait_thread, wait_thread_proc, NULL); if (err != 0) { perror("tds_thread_create"); exit(1); } } if (!return_data) CHKExecDirect(T("WAITFOR DELAY '000:05:00'"), SQL_NTS, "E"); else odbc_command2("SELECT MAX(p1.k) FROM tab1 p1, tab1 p2, tab1 p3, tab1 p4", "E"); tds_mutex_lock(&mtx); exit_thread = 1; tds_mutex_unlock(&mtx); if (!use_threads) { alarm(0); } else { tds_thread_join(wait_thread, NULL); } getErrorInfo(SQL_HANDLE_STMT, odbc_stmt); if (strcmp(C(sqlstate), "HY008") != 0) { fprintf(stderr, "Unexpected sql state returned\n"); odbc_disconnect(); exit(1); } odbc_reset_statement(); odbc_command("SELECT name FROM sysobjects WHERE 0=1"); }
STDMETHODIMP CComDigiDocLib::CollectErrors() { char *errorClass[] = {"NO_ERRORS", "TECHNICAL", "USER", "LIBRARY"}; int err = ERR_OK; string sz_ret = ""; char buf[3000]; while(hasUnreadErrors()) { ErrorInfo* pErr = getErrorInfo(); char* pErrStr = getErrorString(pErr->code); if (pErr->code > 0) { sprintf(buf,"Error: %d - %s; file: %s line: %d; failed condition: %s; error class : %s|", pErr->code, pErrStr, PathFindFileName(pErr->fileName), pErr->line, pErr->assertion, errorClass[getErrorClass(pErr->code)]); error_buf += buf; } } return S_OK; }