45 const std::
string& strSeqId,
47 const std::
string& strFeatureName,
48 const std::
string& strQualifierName,
49 const std::
string& strQualifierValue,
50 const std::
string& strErrorMessage,
85 m_eSeverity(eSeverity),
88 m_strFeatureName(strFeatureName),
89 m_strQualifierName(strQualifierName),
90 m_strQualifierValue(strQualifierValue),
91 m_strErrorMessage(strErrorMessage),
92 m_vecOfOtherLines(vecOfOtherLines)
97 m_eProblem(rhs.m_eProblem),
98 m_eSeverity(rhs.m_eSeverity),
99 m_strSeqId(rhs.m_strSeqId),
100 m_uLine(rhs.m_uLine),
101 m_strFeatureName(rhs.m_strFeatureName),
102 m_strQualifierName(rhs.m_strQualifierName),
103 m_strQualifierValue(rhs.m_strQualifierValue),
104 m_strErrorMessage(rhs.m_strErrorMessage),
105 m_vecOfOtherLines(rhs.m_vecOfOtherLines)
125 result <<
", with other possibly relevant line(s):";
127 result <<
' ' << *line_it;
159 return "Unrecognized feature name";
161 return "Unrecognized qualifier name";
163 return "Numeric qualifier value has extra trailing characters after the number";
165 return "Numeric qualifier value should be a number";
167 return "Feature name not allowed";
169 return "No feature provided on intervals";
171 return "No feature provided for qualifiers";
173 return "Feature bad start and/or stop";
175 return "General parsing error";
177 return "Bad feature interval";
179 return "Qualifier had bad value";
181 return "Invalid score value";
183 return "Value ignored due to missing context";
185 return "Bad track line: Expected \"track key1=value1 key2=value2 ...\"";
187 return "Feature's location has internal partials";
189 return "Feature has xref to a gene, but that gene does NOT contain the feature.";
191 return "Feature is trying to create a gene that conflicts with the gene created by another feature.";
193 return "Unrecognized square bracket command";
195 return "Feature is too long";
197 return "Nucleotide residues unexpectedly found in feature";
199 return "Amino acid residues unexpectedly found in feature";
201 return "Too many ambiguous residues";
203 return "Invalid residue(s)";
205 return "Modifiers were found where none were expected";
207 return "Extraneous modifiers found";
209 return "Expected modifier missing";
211 return "Feature is missing";
213 return "Feature's length must be greater than zero.";
215 return "Could not parse modifiers.";
217 return "Multiple different values for modifier";
219 return "Feature had invalid length, but this was automatically corrected.";
221 return "An invalid residue has been ignored";
223 return "Invalid qualifier for feature";
226 return "Broken ##INFO line";
228 return "Broken ##FORMAT line";
230 return "Broken ##FILTER line";
233 return "Just a progress info message (no error)";
235 return "Unknown problem";
253 const string& seqid =
SeqId();
254 if (! seqid.empty()) {
255 out <<
"SeqId: " << seqid << endl;
258 out <<
"Line: " <<
Line() << endl;
261 if (! feature.empty()) {
262 out <<
"FeatureName: " << feature << endl;
265 if (! qualname.empty()) {
266 out <<
"QualifierName: " << qualname << endl;
269 if (! qualval.empty()) {
270 out <<
"QualifierValue: " << qualval << endl;
273 if (! vecOfLines.empty()) {
274 out <<
"OtherLines:";
276 out <<
' ' << *line_it;
296 const string& seqid =
SeqId();
297 if (! seqid.empty()) {
300 out <<
"line=\"" <<
Line() <<
"\" ";
302 if (! feature.empty()) {
306 if (! qualname.empty()) {
310 if (! qualval.empty()) {
317 out <<
"<other_line>" << *line_it <<
"</other_line>";
320 out <<
"</message>" << endl;
379 m_eProblem(eProblem),
380 m_eSeverity(eSeverity),
383 m_strSeqId(strSeqId),
385 m_strFeatureName(strFeatureName),
386 m_strQualifierName(strQualifierName),
387 m_strQualifierValue(strQualifierValue),
388 m_strErrorMessage(strErrorMessage),
389 m_vecOfOtherLines(vecOfOtherLines)
401 rhs.m_strErrorMessage,
402 rhs.m_strFeatureName,
403 rhs.m_strQualifierName,
404 rhs.m_strQualifierValue,
405 rhs.m_vecOfOtherLines)
432 eSeverity, uLine, strMessage, eProblem, strSeqId, strFeatureName, strQualifierName, strQualifierValue, eErrCode, vecOfOtherLines);
459 m_eProblem(eProblem),
460 m_strSeqId(strSeqId),
461 m_uLineNumber(uLine),
462 m_strFeatureName(strFeatureName),
463 m_strQualifierName(strQualifierName),
464 m_strQualifierValue(strQualifierValue),
465 m_strErrorMessage(strMessage),
466 m_vecOfOtherLines(vecOfOtherLines)
468 SetSeverity(eSeverity);
474 m_eProblem(rhs.Problem()),
475 m_strSeqId(rhs.SeqId()),
476 m_uLineNumber(rhs.
Line()),
477 m_strFeatureName(rhs.FeatureName()),
478 m_strQualifierName(rhs.QualifierName()),
479 m_strQualifierValue(rhs.QualifierValue()),
480 m_strErrorMessage(rhs.ErrorMessage()),
481 m_vecOfOtherLines(rhs.m_vecOfOtherLines),
482 m_pObject(rhs.m_pObject)
void Throw(void) const
copy constructor is protected so please use this function to throw the object.
static CLineErrorEx * Create(EProblem eProblem, EDiagSev eSeverity, int code, int subcode, const std::string &strSeqId, unsigned int uLine, const std::string &strErrorMessage=string(""), const std::string &strFeatureName=string(""), const std::string &strQualifierName=string(""), const std::string &strQualifierValue=string(""), const TVecOfLines &vecOfOtherLines=TVecOfLines())
Use this because the constructor is protected.
virtual ILineError * Clone(void) const override
Use this because copy ctor is protected.
CLineErrorEx(EProblem eProblem, EDiagSev eSeverity, int code, int subcode, const std::string &strSeqId, unsigned int uLine, const std::string &strErrorMessage, const std::string &strFeatureName, const std::string &strQualifierName, const std::string &strQualifierValue, const TVecOfLines &m_vecOfOtherLine)
protected instead of public. Please use the Create function instead.
CLineError(EProblem eProblem, EDiagSev eSeverity, const std::string &strSeqId, unsigned int uLine, const std::string &strFeatureName, const std::string &strQualifierName, const std::string &strQualifierValue, const std::string &strErrorMessage, const TVecOfLines &m_vecOfOtherLine)
protected instead of public. Please use the Create function instead.
void Throw(void) const
copy constructor is protected so please use this function to throw the object.
virtual ILineError * Clone(void) const
Use this because copy ctor is protected.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
std::string ProblemStr() const
CObjReaderLineException(EDiagSev eSeverity, unsigned int uLine, const std::string &strMessage, EProblem eProblem=eProblem_GeneralParsingError, const std::string &strSeqId=string(""), const std::string &strFeatureName=string(""), const std::string &strQualifierName=string(""), const std::string &strQualifierValue=string(""), CObjReaderLineException::EErrCode eErrCode=eFormat, const TVecOfLines &vecOfOtherLines=TVecOfLines())
private instead of public. Please use the Create function instead.
CConstRef< CSerialObject > GetObject() const
EDiagSev Severity(void) const
virtual ILineError * Clone(void) const
Use instead of copy constructor, which is private.
void SetObject(CRef< CSerialObject > pObject)
void Throw(void) const
this function to throw this object.
static CObjReaderLineException * Create(EDiagSev eSeverity, unsigned int uLine, const std::string &strMessage, EProblem eProblem=eProblem_GeneralParsingError, const std::string &strSeqId=string(""), const std::string &strFeatureName=string(""), const std::string &strQualifierName=string(""), const std::string &strQualifierValue=string(""), CObjReaderLineException::EErrCode eErrCode=eFormat, const TVecOfLines &vecOfOtherLines=TVecOfLines())
Please use this instead of the constructor because the ctor is protected.
std::string m_strErrorMessage
CRef< CSerialObject > m_pObject
virtual const string & QualifierName(void) const =0
virtual EDiagSev Severity(void) const
virtual string Message() const
@ eProblem_InvalidQualifier
@ eProblem_QualifierBadValue
@ eProblem_NumericQualifierValueIsNotANumber
@ eProblem_InternalPartialsInFeatLocation
@ eProblem_InvalidResidue
@ eProblem_FeatMustBeInXrefdGene
@ eProblem_IgnoredResidue
@ eProblem_CreatedGeneFromMultipleFeats
@ eProblem_UnrecognizedFeatureName
@ eProblem_ParsingModifiers
@ eProblem_MissingContext
@ eProblem_UnexpectedAminoAcids
@ eProblem_FeatureNameNotAllowed
@ eProblem_ModifierFoundButNoneExpected
@ eProblem_QualifierWithoutFeature
@ eProblem_UnexpectedNucResidues
@ eProblem_FeatureBadStartAndOrStop
@ eProblem_NumericQualifierValueHasExtraTrailingCharacters
@ eProblem_TooManyAmbiguousResidues
@ eProblem_UnrecognizedSquareBracketCommand
@ eProblem_UnrecognizedQualifierName
@ eProblem_BadFeatureInterval
@ eProblem_NonPositiveLength
@ eProblem_ContradictoryModifiers
@ eProblem_ExpectedModifierMissing
@ eProblem_InvalidLengthAutoCorrected
@ eProblem_GeneralParsingError
@ eProblem_ExtraModifierFound
@ eProblem_NoFeatureProvidedOnIntervals
vector< unsigned int > TVecOfLines
virtual int GetCode(void) const
virtual int GetSubCode(void) const
string SeverityStr() const
virtual void Write(CNcbiOstream &out) const
virtual EProblem Problem(void) const =0
virtual string ProblemStr() const
virtual const string & SeqId(void) const =0
virtual unsigned int Line(void) const =0
virtual const TVecOfLines & OtherLines(void) const =0
virtual void WriteAsXML(CNcbiOstream &out) const
virtual const string & QualifierValue(void) const =0
virtual const string & ErrorMessage() const
virtual const string & FeatureName(void) const =0
std::ofstream out("events_result.xml")
main entry point for tests
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
static const char * SeverityName(EDiagSev sev)
Get a common symbolic name for the severity levels.
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Info
Informational message.
EErrCode
Error types that an application can generate.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string XmlEncode(const CTempString str, TXmlEncode flags=eXmlEnc_Contents)
Encode a string for XML.
constexpr bool empty(list< Ts... >) noexcept