CInvalidChoiceSelection::CInvalidChoiceSelection( const CDiagCompileInfo& diag_info, const CSerialObject* object, size_t currentIndex, size_t mustBeIndex, const char* const names[], size_t namesCount, EDiagSev severity) : CSerialException(diag_info, 0, (CSerialException::EErrCode) CException::eInvalid,"") { CNcbiOstrstream msg; const CChoiceTypeInfo* type = 0; if ( object ) { type = dynamic_cast<const CChoiceTypeInfo*>(object->GetThisTypeInfo()); } const char* cur_name = GetName(currentIndex, names, namesCount); const char* req_name = GetName(mustBeIndex, names, namesCount); if ( type ) { msg << "C" << SPrintIdentifier(type->GetAccessName()) << "::Get" << SPrintIdentifier(req_name) << "()"; msg << ": Invalid choice selection: " << type->GetAccessModuleName() <<"::"<< type->GetAccessName() << '.' << cur_name; } else { msg << "Invalid choice selection: " << cur_name << ". Expected: " << req_name; } x_Init(diag_info, CNcbiOstrstreamToString(msg), 0, severity); x_InitErrCode((CException::EErrCode)(CInvalidChoiceSelection::eFail)); }
CObjReaderLineException::CObjReaderLineException(const CObjReaderLineException & rhs ) : CObjReaderParseException( rhs ), m_eProblem(rhs.Problem()), m_strSeqId(rhs.SeqId()), m_uLineNumber(rhs.Line()), m_strFeatureName(rhs.FeatureName()), m_strQualifierName(rhs.QualifierName()), m_strQualifierValue(rhs.QualifierValue()), m_strErrorMessage(rhs.ErrorMessage()), m_vecOfOtherLines(rhs.m_vecOfOtherLines) { SetSeverity( rhs.Severity() ); x_InitErrCode(static_cast<CException::EErrCode>(rhs.x_GetErrCode())); }
CInvalidChoiceSelection::CInvalidChoiceSelection( size_t currentIndex, size_t mustBeIndex, const char* const names[], size_t namesCount, EDiagSev severity) : CSerialException(CDiagCompileInfo("unknown", 0), 0, (CSerialException::EErrCode) CException::eInvalid,"") { x_Init(CDiagCompileInfo("unknown", 0), string("Invalid choice selection: ")+ GetName(currentIndex, names, namesCount)+". " "Expected: "+ GetName(mustBeIndex, names, namesCount),0, severity); x_InitErrCode((CException::EErrCode)(CInvalidChoiceSelection::eFail)); }
CObjReaderLineException::CObjReaderLineException( EDiagSev eSeverity, unsigned int uLine, const std::string &strMessage, EProblem eProblem, const std::string& strSeqId, const std::string & strFeatureName, const std::string & strQualifierName, const std::string & strQualifierValue, CObjReaderLineException::EErrCode eErrCode, const TVecOfLines & vecOfOtherLines ) : CObjReaderParseException( DIAG_COMPILE_INFO, 0, static_cast<CObjReaderParseException::EErrCode>(CException::eInvalid), strMessage, uLine, eDiag_Info ), m_eProblem(eProblem), m_strSeqId(strSeqId), m_uLineNumber(uLine), m_strFeatureName(strFeatureName), m_strQualifierName(strQualifierName), m_strQualifierValue(strQualifierValue), m_strErrorMessage(strMessage), m_vecOfOtherLines(vecOfOtherLines) { SetSeverity( eSeverity ); x_InitErrCode(static_cast<CException::EErrCode>(eErrCode)); }