void XlfOperImpl::ThrowOnError(int xlret, const char* ErrorId, const char* Identifier) { if (xlret & xlretUncalced) throw XlfExceptionUncalculated(); if (xlret & xlretAbort) throw XlfExceptionAbort(); if (xlret & xlretStackOvfl) throw XlfExceptionStackOverflow(); if (xlret & xlretInvXloper) THROW_XLW(CombineErrorString("invalid OPER structure (memory could be exhausted)" , ErrorId, Identifier)); if (xlret & xlretFailed) THROW_XLW(CombineErrorString("command failed" , ErrorId, Identifier)); if (xlret & xlretInvCount) THROW_XLW(CombineErrorString("invalid number of arguments" , ErrorId, Identifier)); if (xlret & xlretInvXlfn) THROW_XLW(CombineErrorString("invalid function number" , ErrorId, Identifier)); if (xlret & xlRetInvAsynchronousContext) THROW_XLW(CombineErrorString("invalid asynch conext" , ErrorId, Identifier)); if (xlret & xlretNotClusterSafe) THROW_XLW(CombineErrorString("function not cluster safe" , ErrorId, Identifier)); }
int xlw::XlfOper4::ThrowOnError(int xlret, const std::string& Identifier) const { if (xlret == xlretSuccess) return xlret; if (xlret & xlretUncalced) throw XlfExceptionUncalculated(); if (xlret & xlretAbort) throw XlfExceptionAbort(); if (xlret & xlretStackOvfl) throw XlfExceptionStackOverflow(); if (xlret & xlretInvXloper) throw XlfException("invalid OPER structure (memory could be exhausted),"+Identifier); if (xlret & xlretFailed) throw std::runtime_error("command failed, "+Identifier); if (xlret & xlretInvCount) throw std::runtime_error("invalid number of argument, "+Identifier); if (xlret & xlretInvXlfn) throw std::runtime_error("invalid function number, "+Identifier); // should never get here. assert(0); return xlret; }