libSBML C++ API  libSBML 5.8.0 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SBMLError Class Reference
Inheritance diagram for SBMLError:
[legend]

Detailed Description

Representation of errors, warnings and other diagnostics.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

When a libSBML operation on SBML content results in an error, or when there is something wrong with the SBML content, the problems are reported as SBMLError objects. These are generally stored in an SBMLErrorLog object; this log object, in turn, is kept in the SBMLDocument object containing the SBML content. Applications can obtain the list of logged errors using SBMLDocument::getErrorLog() and then use the methods provided by SBMLErrorLog to access individual SBMLError objects. (Note that despite the word "error" in the name, SBMLError objects are used to represent not only "true" errors, but also warnings and some informational diagnostics. The name is a historical hold-over from early versions of libSBML, in which the object really was only used to report errors.)

Each SBMLError object instance has an identification number that identifies the nature of the problem. This "error id" number will be up to five digits long, and it will be listed in one of two enumerations: SBMLErrorCode_t (described below) or XMLErrorCode_t (described in the documentation for the class XMLError). The former enumeration contains all the SBML validation rule numbers listed in the appendices of the SBML specification documents, as well as some additional libSBML-specific error codes.

Error codes are useful mainly for software. For human readers, SBMLError also includes text messages that describe the nature of a given problem. The messages can be accessed using SBMLError::getShortMessage() and SBMLError::getMessage(). The former provides a brief one-line description of the issue, while SBMLError::getMessage() provides a more detailed text, including (if appropriate) references to sections of the SBML specifications where relevant topics are discussed. These text strings are suitable for displaying to human users.

An SBMLError object also contains a category code; its value may be retrieved using the method SBMLError::getCategory(). Category values are drawn from the enumeration SBMLErrorCategory_t described below. Categories are used to partition errors into distinct conceptual groups. This is principally used by the libSBML validation system to group classes of validation checks. For example, LIBSBML_CAT_IDENTIFIER_CONSISTENCY is the category for tests that check identifier consistency; LIBSBML_CAT_MATHML_CONSISTENCY is the category for MathML consistency checking; and so on.

In addition, SBMLError also has a severity code. Its value may be retrieved using the method SBMLError::getSeverity(). The possible severity values are the same as those reported by XMLError. Severity levels currently range from informational (LIBSBML_SEV_INFO) to fatal errors (LIBSBML_SEV_FATAL). They can be used by an application to evaluate how serious a given problem is.

Finally, SBMLError records the line and column near where the problem occurred in the SBML content. The values may be retrieved using the methods SBMLError::getLine() and SBMLError::getColumn(). We say "near", because a lot of factors affect how accurate the line/column information ultimately is. For example, different XML parsers have different conventions for which line and column number they report for a particular problem (which makes a difference when a problem involves an opening XML tag on one line and a closing tag on another line). In some situations, some parsers report invalid line and/or column numbers altogether. If this occurs, libSBML sets the line and/or column number in the SBMLError object to the the value of the maximum unsigned long integer representable on the platform where libSBML is running. (This is equal to the constant named ULONG_MAX in C and C++.) The probability that a true line or column number in an SBML model would equal this value is vanishingly small; thus, if an application encounters these values in an XMLError object, it can assume no valid line/column number could be provided by libSBML in that situation.

SBMLErrorCode_t

SBMLErrorCode_t is an enumeration of all SBML-level error, warning and informational diagnostic codes. Every SBMLError object has an error code value that can be either a value from this enumeration, or a value from the XMLErrorCode_t enumeration (see the documentation for XMLError). The latter values apply when the error or warning signifies a basic XML issue rather than an SBML issue per se. The values of SBMLErrorCode_t are distinguished from those of XMLErrorCode_t by being numbered 10000 and higher, while the XML layer's codes are 9999 and lower. The method SBMLError::getErrorId() returns the error code of a given SBMLError object instance.

The following is a table of the symbolic names of SBMLErrorCode_t values and the meaning of each code. In this table, the right-hand columns titled "L1V1", "L1V2", etc. refer to Levels and Versions of the SBML specifications, and the entries in each column refer to whether the severity of the condition in that particular Level+Version of SBML. The codes stand for the following:

N= Not applicable
I= Informational
W= Warning
E= Error
F= Fatal

The text shown in the "Meaning" is the text returned by the SBMLError::getShortMessage() method on a given SBMLError object. A longer and (hopefully) clearer explanation of the issue is returned by SBMLError::getMessage().

Enumerator Meaning L 1 V 1 L 1 V 2 L 2 V 1 L 2 V 2 L 2 V 3 L 2 V 4 L 3 V 1
UnknownErrorEncountered unknown internal libSBML errorFFFFFFF
NotUTF8File does not use UTF-8 encodingEEEEEEE
UnrecognizedElementEncountered unrecognized elementEEEEEEE
NotSchemaConformantDocument does not conform to the SBML XML schemaEEEEEEE
L3NotSchemaConformantDocument is not well-formed XMLNNNNNNE
InvalidMathElementInvalid MathMLNNEEEEE
DisallowedMathMLSymbolDisallowed MathML symbol foundNNEEEEE
DisallowedMathMLEncodingUseUse of the MathML 'encoding' attribute is not allowed on this elementNNEEEEE
DisallowedDefinitionURLUseUse of the MathML 'definitionURL' attribute is not allowed on this elementNNEEEEE
BadCsymbolDefinitionURLValueInvalid <csymbol> 'definitionURL' attribute valueNNEEEEE
DisallowedMathTypeAttributeUseUse of the MathML 'type' attribute is not allowed on this elementNNEEEEE
DisallowedMathTypeAttributeValueDisallowed MathML 'type' attribute valueNNEEEEE
LambdaOnlyAllowedInFunctionDefUse of <lambda> not permitted outside of FunctionDefinition objectsNNEEEEE
BooleanOpsNeedBooleanArgsNon-Boolean argument given to Boolean operatorNNWEEEE
NumericOpsNeedNumericArgsNon-numerical argument given to numerical operatorNNWEEEE
ArgsToEqNeedSameTypeArguments to <eq> and <neq> must have the same data typesNNWEEEE
PiecewiseNeedsConsistentTypesTerms in a <piecewise> expression must have consistent data typesNNWEEEE
PieceNeedsBooleanThe second argument of a <piece> expression must yield a Boolean valueNNWEEEE
ApplyCiMustBeUserFunctionA <ci> element in this context must refer to a function definitionNNWEEEE
ApplyCiMustBeModelComponentA <ci> element in this context must refer to a model componentNNWEEEE
KineticLawParametersAreLocalOnlyCannot use a KineticLaw local parameter outside of its local scopeNNWEEEE
MathResultMustBeNumericA formula's result in this context must be a numerical valueNNWEEEE
OpsNeedCorrectNumberOfArgsIncorrect number of arguments given to MathML operatorNNWEEEE
InvalidNoArgsPassedToFunctionDefIncorrect number of arguments given to function invocationNNNNNEE
DisallowedMathUnitsUseAttribute 'units' is only permitted on <cn> elementsNNNNNNE
InvalidUnitsValueInvalid value given for the 'units' attributeNNNNNNE
DuplicateComponentIdDuplicate 'id' attribute valueEEEEEEE
DuplicateUnitDefinitionIdDuplicate unit definition 'id' attribute valueEEEEEEE
DuplicateLocalParameterIdDuplicate local parameter 'id' attribute valueEEEEEEE
MultipleAssignmentOrRateRulesMultiple rules for the same variable are not allowedEEEEEEE
MultipleEventAssignmentsForIdMultiple event assignments for the same variable are not allowedNNEEEEE
EventAndAssignmentRuleForIdAn event assignment and an assignment rule must not have the same value for 'variable'NNEEEEE
DuplicateMetaIdDuplicate 'metaid' attribute valueNNEEEEE
InvalidSBOTermSyntaxInvalid syntax for an 'sboTerm' attribute valueNNNEEEE
InvalidMetaidSyntaxInvalid syntax for a 'metaid' attribute valueNNEEEEE
InvalidIdSyntaxInvalid syntax for an 'id' attribute valueEEEEEEE
InvalidUnitIdSyntaxInvalid syntax for the identifier of a unitNNNEEEE
InvalidNameSyntaxInvalid syntax for a 'name' attribute valueNNNNNNE
MissingAnnotationNamespaceMissing declaration of the XML namespace for the annotationNNNEEEE
DuplicateAnnotationNamespacesMultiple annotations using the same XML namespaceNNNEEEE
SBMLNamespaceInAnnotationThe SBML XML namespace cannot be used in an Annotation objectNNNEEEN
MultipleAnnotationsOnly one Annotation object is permitted under a given SBML objectNNNNNNE
InconsistentArgUnitsThe units of the function call's arguments are not consistent with its definitionWWWEEWW
InconsistentKineticLawUnitsL3The kinetic law's units are inconsistent with those of other kinetic laws in the modelNNNNNNW
AssignRuleCompartmentMismatchMismatched units in assignment rule for compartmentEEEEEWW
AssignRuleSpeciesMismatchMismatched units in assignment rule for speciesEEEEEWW
AssignRuleParameterMismatchMismatched units in assignment rule for parameterEEEEEWW
AssignRuleStoichiometryMismatchMismatched units in assignment rule for stoichiometryNNNNNNW
InitAssignCompartmenMismatchMismatched units in initial assignment to compartmentNNNEEWW
InitAssignSpeciesMismatchMismatched units in initial assignment to speciesNNNEEWW
InitAssignParameterMismatchMismatched units in initial assignment to parameterNNNEEWW
InitAssignStoichiometryMismatchMismatched units in initial assignment to stoichiometryNNNNNNW
RateRuleCompartmentMismatchMismatched units in rate rule for compartmentEEEEEWW
RateRuleSpeciesMismatchMismatched units in rate rule for speciesEEEEEWW
RateRuleParameterMismatchMismatched units in rate rule for parameterEEEEEWW
RateRuleStoichiometryMismatchMismatched units in rate rule for stoichiometryNNNNNNW
KineticLawNotSubstancePerTimeThe units of the kinetic law are not 'substance'/'time'EEEEEWW
SpeciesInvalidExtentUnitsThe species' units are not consistent with units of extentNNNNNNW
DelayUnitsNotTimeThe units of the delay expression are not units of timeNNEEEWW
EventAssignCompartmentMismatchMismatched units in event assignment for compartmentNNEEEWW
EventAssignSpeciesMismatchMismatched units in event assignment for speciesNNEEEWW
EventAssignParameterMismatchMismatched units in event assignment for parameterNNEEEWW
EventAssignStoichiometryMismatchMismatched units in event assignment for stoichiometryNNNNNNW
PriorityUnitsNotDimensionlessThe units of a priority expression must be 'dimensionless'NNNNNNW
UpperUnitBoundUpper boundary of unit validation diagnostic codesNNNNNNN
OverdeterminedSystemThe model is overdeterminedWWWEEEE
InvalidModelSBOTermInvalid 'sboTerm' attribute value for a Model objectNNNEEWW
InvalidFunctionDefSBOTermInvalid 'sboTerm' attribute value for a FunctionDefinition objectNNNEEWW
InvalidParameterSBOTermInvalid 'sboTerm' attribute value for a Parameter objectNNNEEWW
InvalidInitAssignSBOTermInvalid 'sboTerm' attribute value for an InitialAssignment objectNNNEEWW
InvalidRuleSBOTermInvalid 'sboTerm' attribute value for a Rule objectNNNEEWW
InvalidConstraintSBOTermInvalid 'sboTerm' attribute value for a Constraint objectNNNEEWW
InvalidReactionSBOTermInvalid 'sboTerm' attribute value for a Reaction objectNNNEEWW
InvalidSpeciesReferenceSBOTermInvalid 'sboTerm' attribute value for a SpeciesReference objectNNNEEWW
InvalidKineticLawSBOTermInvalid 'sboTerm' attribute value for a KineticLaw objectNNNEEWW
InvalidEventSBOTermInvalid 'sboTerm' attribute value for an Event objectNNNEEWW
InvalidEventAssignmentSBOTermInvalid 'sboTerm' attribute value for an EventAssignment objectNNNEEWW
InvalidCompartmentSBOTermInvalid 'sboTerm' attribute value for a Compartment objectNNNNEWW
InvalidSpeciesSBOTermInvalid 'sboTerm' attribute value for a Species objectNNNNEWW
InvalidCompartmentTypeSBOTermInvalid 'sboTerm' attribute value for a CompartmentType objectNNNNEWN
InvalidSpeciesTypeSBOTermInvalid 'sboTerm' attribute value for a SpeciesType objectNNNNEWN
InvalidTriggerSBOTermInvalid 'sboTerm' attribute value for an Event Trigger objectNNNNEWW
InvalidDelaySBOTermInvalid 'sboTerm' attribute value for an Event Delay objectNNNNEWW
NotesNotInXHTMLNamespaceNotes must be placed in the XHTML XML namespaceEEEEEEE
NotesContainsXMLDeclXML declarations are not permitted in Notes objectsNNNEEEE
NotesContainsDOCTYPEXML DOCTYPE elements are not permitted in Notes objectsNNNEEEE
InvalidNotesContentInvalid notes content foundNNNEEEN
OnlyOneNotesElementAllowedOnly one Notes subobject is permitted on a given SBML objectNNNNNNE
InvalidNamespaceOnSBMLInvalid XML namespace for the SBML container elementEEEEEEE
MissingOrInconsistentLevelMissing or inconsistent value for the 'level' attributeEEEEEEE
MissingOrInconsistentVersionMissing or inconsistent value for the 'version' attributeEEEEEEE
PackageNSMustMatchInconsistent or invalid SBML Level/Version for the package namespace declarationNNNNNNE
LevelPositiveIntegerThe 'level' attribute must have a positive integer valueNNNNNNE
VersionPositiveIntegerThe 'version' attribute must have a positive integer valueNNNNNNE
AllowedAttributesOnSBMLInvalid attribute found on the SBML container elementNNNNNNE
L3PackageOnLowerSBMLAn L3 package ns found on the SBML container element.WWWWWWN
MissingModelNo model definition foundEEEEEEE
IncorrectOrderInModelIncorrect ordering of components within the Model objectEEEEEEN
EmptyListElementEmpty ListOf___ object foundEEEEEEE
NeedCompartmentIfHaveSpeciesThe presence of a species requires a compartmentEEEEEEE
OneOfEachListOfOnly one of each kind of ListOf___ object is allowed inside a Model objectNNNNNNE
OnlyFuncDefsInListOfFuncDefsOnly FunctionDefinition, Notes and Annotation objects are allowed in ListOfFunctionDefinitionsNNNNNNE
OnlyUnitDefsInListOfUnitDefsOnly UnitDefinition, Notes and Annotation objects are allowed in ListOfUnitDefinitions objectsNNNNNNE
OnlyCompartmentsInListOfCompartmentsOnly Compartment, Notes and Annotation objects are allowed in ListOfCompartments objectsNNNNNNE
OnlySpeciesInListOfSpeciesOnly Species, Notes and Annotation objects are allowed in ListOfSpecies objectsNNNNNNE
OnlyParametersInListOfParametersOnly Parameter, Notes and Annotation objects are allowed in ListOfParameters objectsNNNNNNE
OnlyInitAssignsInListOfInitAssignsOnly InitialAssignment, Notes and Annotation objects are allowed in ListOfInitialAssignments objectsNNNNNNE
OnlyRulesInListOfRulesOnly Rule, Notes and Annotation objects are allowed in ListOfRules objectsNNNNNNE
OnlyConstraintsInListOfConstraintsOnly Constraint, Notes and Annotation objects are allowed in ListOfConstraints objectsNNNNNNE
OnlyReactionsInListOfReactionsOnly Reaction, Notes and Annotation objects are allowed in ListOfReactions objectsNNNNNNE
OnlyEventsInListOfEventsOnly Event, Notes and Annotation objects are allowed in ListOfEvents objectsNNNNNNE
L3ConversionFactorOnModelA 'conversionFactor' attribute value must reference a Parameter objectNNNNNNE
L3TimeUnitsOnModelInvalid 'timeUnits' attribute valueNNNNNNW
L3VolumeUnitsOnModelInvalid 'volumeUnits' attribute valueNNNNNNW
L3AreaUnitsOnModelInvalid 'areaUnits' attribute valueNNNNNNW
L3LengthUnitsOnModelInvalid 'lengthUnits' attribute valueNNNNNNW
L3ExtentUnitsOnModelInvalid 'extentUnits' attribute valueNNNNNNW
AllowedAttributesOnModelInvalid attribute found on the Model objectNNNNNNE
AllowedAttributesOnListOfFuncsInvalid attribute found on the ListOfFunctionDefinitions objectNNNNNNE
AllowedAttributesOnListOfUnitDefsInvalid attribute found on the ListOfUnitDefinitions objectNNNNNNE
AllowedAttributesOnListOfCompsInvalid attribute found on the ListOfCompartments objectNNNNNNE
AllowedAttributesOnListOfSpeciesInvalid attribute found on the ListOfSpecies objectNNNNNNE
AllowedAttributesOnListOfParamsInvalid attribute found on the ListOfParameters objectNNNNNNE
AllowedAttributesOnListOfInitAssignInvalid attribute found on the ListOfInitialAssignments objectNNNNNNE
AllowedAttributesOnListOfRulesInvalid attribute found on the ListOfRules objectNNNNNNE
AllowedAttributesOnListOfConstraintsInvalid attribute found on the ListOfConstraints objectNNNNNNE
AllowedAttributesOnListOfReactionsInvalid attribute found on the ListOfReactions objectNNNNNNE
AllowedAttributesOnListOfEventsInvalid attribute found on the ListOfEvents objectNNNNNNE
FunctionDefMathNotLambdaInvalid expression found in the function definitionNNEEEEE
InvalidApplyCiInLambdaInvalid forward reference in the MathML <apply><ci>...</ci></apply> expressionNNEEENN
RecursiveFunctionDefinitionRecursive function definitions are not permittedNNEEEEE
InvalidCiInLambdaInvalid <ci> reference found inside the <lambda> mathematical formulaNNEEEEE
InvalidFunctionDefReturnTypeA function's return type must be either a number or a BooleanNNEEEEE
OneMathElementPerFuncA FunctionDefinition object must contain one <math> elementNNNNNNE
AllowedAttributesOnFuncInvalid attribute found on the FunctionDefinition objectNNNNNNE
InvalidUnitDefIdInvalid 'id' attribute value for a UnitDefinition objectEEEEEEE
InvalidSubstanceRedefinitionInvalid redefinition of built-in type 'substance'EEEEEEN
InvalidLengthRedefinitionInvalid redefinition of built-in type 'length'WWEEEEN
InvalidAreaRedefinitionInvalid redefinition of built-in type name 'area'WWEEEEN
InvalidTimeRedefinitionInvalid redefinition of built-in type name 'time'EEEEEEN
InvalidVolumeRedefinitionInvalid redefinition of built-in type name 'volume'EEEEEEN
VolumeLitreDefExponentNotOneMust use 'exponent'=1 when defining 'volume' in terms of litresEEEEENN
VolumeMetreDefExponentNot3Must use 'exponent'=3 when defining 'volume' in terms of metresNNEEENN
EmptyListOfUnitsAn empty list of Unit objects is not permitted in a UnitDefinition objectEEEEEEN
InvalidUnitKindInvalid value for the 'kind' attribute of a UnitDefinition objectEEEEEEE
OffsetNoLongerValidUnit attribute 'offset' is not supported in this Level+Version of SBMLNNNEEEN
CelsiusNoLongerValidUnit name 'Celsius' is not defined in this Level+Version of SBMLNNNEEEN
EmptyUnitListElementA ListOfUnits object must not be emptyNNNNNNE
OneListOfUnitsPerUnitDefAt most one ListOfUnits object is allowed inside a UnitDefinition objectNNNNNNE
OnlyUnitsInListOfUnitsOnly Unit, Notes and Annotation objects are allowed in ListOfUnits objectsNNNNNNE
AllowedAttributesOnUnitDefinitionInvalid attribute found on the UnitDefinition objectNNNNNNE
AllowedAttributesOnListOfUnitsInvalid attribute found on the ListOfUnits objectNNNNNNE
AllowedAttributesOnUnitInvalid attribute found on the Unit objectNNNNNNE
ZeroDimensionalCompartmentSizeInvalid use of the 'size' attribute for a zero-dimensional compartmentNNEEEEN
ZeroDimensionalCompartmentUnitsInvalid use of the 'units' attribute for a zero-dimensional compartmentNNEEEEN
ZeroDimensionalCompartmentConstZero-dimensional compartments must be defined to be constantNNEEEEN
UndefinedOutsideCompartmentInvalid value for the 'outside' attribute of a Compartment objectEEEEEEN
RecursiveCompartmentContainmentRecursive nesting of compartments via the 'outside' attribute is not permittedWWWEEEN
ZeroDCompartmentContainmentInvalid nesting of zero-dimensional compartmentsNNWEEEN
Invalid1DCompartmentUnitsInvalid value for the 'units' attribute of a one-dimensional compartmentNNEEEEW
Invalid2DCompartmentUnitsInvalid value for the 'units' attribute of a two-dimensional compartmentNNEEEEW
Invalid3DCompartmentUnitsInvalid value for the 'units' attribute of a three-dimensional compartmentEEEEEEW
InvalidCompartmentTypeRefInvalid value for the 'compartmentType' attribute of a compartmentNNNEEEN
OneDimensionalCompartmentUnitsNo units defined for 1-D compartmentNNNNNNW
TwoDimensionalCompartmentUnitsNo units defined for 2-D compartmentNNNNNNW
ThreeDimensionalCompartmentUnitsNo units defined for 3-D Compartment objectNNNNNNW
AllowedAttributesOnCompartmentInvalid attribute found on Compartment objectNNNNNNE
NoUnitsOnCompartmentNo units defined for Compartment objectNNNNNNW
InvalidSpeciesCompartmentRefInvalid value found for Species 'compartment' attributeEEEEEEE
HasOnlySubsNoSpatialUnitsAttribute 'spatialSizeUnits' must not be set if 'hasOnlySubstanceUnits'='true'NNEENNN
NoSpatialUnitsInZeroDAttribute 'spatialSizeUnits' must not be set if the compartment is zero-dimensionalNNEENNN
NoConcentrationInZeroDAttribute 'initialConcentration' must not be set if the compartment is zero-dimensionalNNEEEEN
SpatialUnitsInOneDInvalid value for 'spatialSizeUnits' attribute of a one-dimensional compartmentNNEENNN
SpatialUnitsInTwoDInvalid value for the 'spatialSizeUnits' attribute of a two-dimensional compartmentNNEENNN
SpatialUnitsInThreeDInvalid value for the 'spatialSizeUnits' attribute of a three-dimensional compartmentNNEENNN
InvalidSpeciesSusbstanceUnitsInvalid value for a Species 'units' attributeEEEEEEW
BothAmountAndConcentrationSetCannot set both 'initialConcentration' and 'initialAmount' attributes simultaneouslyNNEEEEE
NonBoundarySpeciesAssignedAndUsedCannot use a non-boundary species in both reactions and rules simultaneouslyWWEEEEE
NonConstantSpeciesUsedCannot use a constant, non-boundary species as a reactant or productNNEEEEE
InvalidSpeciesTypeRefInvalid value for the 'speciesType' attribute of a speciesNNNEEEN
MultSpeciesSameTypeInCompartmentCannot have multiple species of the same species type in the same compartmentNNNEEEN
MissingSpeciesCompartmentMissing value for the 'compartment' attributeEEEEEEE
SpatialSizeUnitsRemovedAttribute 'spatialSizeUnits' is not supported in this Level+Version of SBMLNNNNEEN
SubstanceUnitsOnSpeciesNo substance units defined for the speciesNNNNNNW
ConversionFactorOnSpeciesInvalid value for the 'conversionFactor' attributeNNNNNNE
AllowedAttributesOnSpeciesInvalid attribute found on Species objectNNNNNNE
InvalidParameterUnitsInvalid value for the 'units' attribute of a Parameter objectEEEEEEW
ParameterUnitsNo units defined for the parameterNNNNNNW
ConversionFactorMustConstantA conversion factor must reference a Parameter object declared to be a constantNNNNNNE
AllowedAttributesOnParameterInvalid attribute found on Parameter objectNNNNNNE
InvalidInitAssignSymbolInvalid value for the 'symbol' attribute of an InitialAssignment objectNNNEEEE
MultipleInitAssignmentsMultiple initial assignments for the same 'symbol' value are not allowedNNNEEEE
InitAssignmentAndRuleForSameIdCannot set a value using both an initial assignment and an assignment rule simultaneouslyNNNEEEE
OneMathElementPerInitialAssignAn InitialAssignment object must contain one <math> elementNNNNNNE
AllowedAttributesOnInitialAssignInvalid attribute found on an InitialAssignment objectNNNNNNE
InvalidAssignRuleVariableInvalid value for the 'variable' attribute of an AssignmentRule objectEEEEEEE
InvalidRateRuleVariableInvalid value for the 'variable' attribute of a RateRule objectEEEEEEE
AssignmentToConstantEntityAn assignment rule cannot assign an entity declared to be constantNNEEEEE
RateRuleForConstantEntityA rate rule cannot assign an entity declared to be constantNNEEEEE
CircularRuleDependencyCircular dependencies involving rules and reactions are not permittedNNNEEEE
OneMathElementPerRuleA rule object must contain one <math> elementNNNNNNE
AllowedAttributesOnAssignRuleInvalid attribute found on an AssignmentRule objectNNNNNNE
AllowedAttributesOnRateRuleInvalid attribute found on a RateRule objectNNNNNNE
AllowedAttributesOnAlgRuleInvalid attribute found on an AlgebraicRule objectNNNNNNE
ConstraintMathNotBooleanA Constraint object's <math> must evaluate to a Boolean valueNNNEEEE
IncorrectOrderInConstraintSubobjects inside the Constraint object are not in the prescribed orderNNNEEEN
ConstraintNotInXHTMLNamespaceA Constraint's Message subobject must be in the XHTML XML namespaceNNNEEEN
ConstraintContainsXMLDeclXML declarations are not permitted within Constraint's Message objectsNNNEEEE
ConstraintContainsDOCTYPEXML DOCTYPE elements are not permitted within Constraint's Message objectsNNNEEEE
InvalidConstraintContentInvalid content for a Constraint object's Message objectNNNEEEN
OneMathElementPerConstraintA Constraint object must contain one <math> elementNNNNNNE
OneMessageElementPerConstraintA Constraint object must contain one Message subobjectNNNNNNE
AllowedAttributesOnConstraintInvalid attribute found on Constraint objectNNNNNNE
NoReactantsOrProductsCannot have a reaction with neither reactants nor productsEEEEEEE
IncorrectOrderInReactionSubobjects inside the Reaction object are not in the prescribed orderEEEEEEN
EmptyListInReactionReaction components, if present, cannot be emptyEEEEEEE
InvalidReactantsProductsListInvalid object found in the list of reactants or productsEEEEEEE
InvalidModifiersListInvalid object found in the list of modifiersNNEEEEE
OneSubElementPerReactionA Reaction object can only contain one of each allowed type of objectNNNNNNE
CompartmentOnReactionInvalid value for the Reaction 'compartment' attributeNNNNNNE
AllowedAttributesOnReactionInvalid attribute for a Reaction objectNNNNNNE
InvalidSpeciesReferenceInvalid 'species' attribute value in SpeciesReference objectEEEEEEE
BothStoichiometryAndMathThe 'stoichiometry' attribute and StoichiometryMath subobject are mutually exclusiveNNEEEEN
AllowedAttributesOnSpeciesReferenceInvalid attribute found on the SpeciesReference objectNNNNNNE
AllowedAttributesOnModifierInvalid attribute found on the ModifierSpeciesReference objectNNNNNNE
UndeclaredSpeciesRefUnknown species referenced in the kinetic law <math> formulaWWEEEEE
IncorrectOrderInKineticLawIncorrect ordering of components in the KineticLaw objectNNEEEEN
EmptyListInKineticLawThe list of parameters, if present, cannot be emptyEEEEEEE
NonConstantLocalParameterParameters local to a KineticLaw object must have a 'constant' attribute value of 'true'NNWEEEN
SubsUnitsNoLongerValidAttribute 'substanceUnits' is not supported in this Level+Version of SBMLNNNEEEN
TimeUnitsNoLongerValidAttribute 'timeUnits' is not supported in this Level+Version of SBMLNNNEEEN
OneListOfPerKineticLawOnly one ListOfLocalParameters object is permitted within a KineticLaw objectNNNNNNE
OnlyLocalParamsInListOfLocalParamsOnly LocalParameter, Notes and Annotation objects are allowed in ListOfLocalParameter objectsNNNNNNE
AllowedAttributesOnListOfLocalParamInvalid attribute found on the ListOfLocalParameters objectNNNNNNE
OneMathPerKineticLawOnly one <math> element is allowed in a KineticLaw objectNNEEEEE
UndeclaredSpeciesInStoichMathUnknown species referenced in the StoichiometryMath object's <math> formulaNNWEEEN
AllowedAttributesOnKineticLawInvalid attribute found on the KineticLaw objectNNNNNNE
AllowedAttributesOnListOfSpeciesRefInvalid attribute found on the ListOfSpeciesReferences objectNNNNNNE
AllowedAttributesOnListOfModsInvalid attribute found on the ListOfModifiers objectNNNNNNE
AllowedAttributesOnLocalParameterInvalid attribute found on the LocalParameter objectNNNNNNE
MissingTriggerInEventThe Event object is missing a Trigger subobjectNNEEEEE
TriggerMathNotBooleanA Trigger object's <math> expression must evaluate to a Boolean valueNNEEEEE
MissingEventAssignmentThe Event object is missing an EventAssignment subobjectNNEEEEE
TimeUnitsEventUnits referenced by 'timeUnits' attribute are not compatible with units of timeNNEENNN
IncorrectOrderInEventIncorrect ordering of components in Event objectNNEEEEN
ValuesFromTriggerTimeNeedDelayAttribute 'useValuesFromTriggerTime'='false', but the Event object does not define a delayNNNNNEN
DelayNeedsValuesFromTriggerTimeThe use of a Delay object requires the Event attribute 'useValuesFromTriggerTime'NNNNNNN
OneMathPerTriggerA Trigger object must have one <math> elementNNNNNNE
OneMathPerDelayA Delay object must have one <math> elementNNNNNNE
InvalidEventAssignmentVariableInvalid 'variable' attribute value in Event objectNNEEEEE
EventAssignmentForConstantEntityAn EventAssignment object cannot assign to a component having attribute 'constant'='true'NNWEEEE
OneMathPerEventAssignmentAn EventAssignment object must have one <math> elementNNNNNNE
AllowedAttributesOnEventAssignmentInvalid attribute found on the EventAssignment objectNNNNNNE
OnlyOneDelayPerEventAn Event object can only have one Delay subobjectNNNNNNE
OneListOfEventAssignmentsPerEventAn Event object can only have one ListOfEventAssignments subobjectNNNNNNE
OnlyEventAssignInListOfEventAssignOnly EventAssignment, Notes and Annotation objects are allowed in ListOfEventAssignmentsNNNNNNE
AllowedAttributesOnListOfEventAssignInvalid attribute found on the ListOfEventAssignments objectNNNNNNE
AllowedAttributesOnEventInvalid attribute found on the Event objectNNNNNNE
AllowedAttributesOnTriggerInvalid attribute found on the Trigger objectNNNNNNE
AllowedAttributesOnDelayInvalid attribute found on the Delay objectNNNNNNE
PersistentNotBooleanThe Trigger attribute 'persistent' must evaluate to a Boolean valueNNNNNNE
InitialValueNotBooleanThe Trigger attribute 'initialValue' must evaluate to a Boolean valueNNNNNNE
OnlyOnePriorityPerEventAn Event object can only have one Priority subobjectNNNNNNE
OneMathPerPriorityA Priority object must have one <math> elementNNNNNNE
AllowedAttributesOnPriorityInvalid attribute found on the Priority objectNNNNNNE
GeneralWarningNotSpecifiedUnknown errorNNNNNNN
CompartmentShouldHaveSizeIt's best to define a size for every compartment in a modelNNWWWWW
SpeciesShouldHaveValueIt's best to define an initial amount or initial concentration for every species in a modelNNWWWWW
ParameterShouldHaveUnitsIt's best to declare units for every parameter in a modelWWWWWWW
LocalParameterShadowsIdLocal parameters defined within a kinetic law shadow global object symbolsWWWWWWW
CannotConvertToL1V1Cannot convert to SBML Level 1 Version 1NEEEEEE
NoEventsInL1SBML Level 1 does not support eventsNNEEEEE
NoFunctionDefinitionsInL1SBML Level 1 does not support function definitionsNNWWWWW
NoConstraintsInL1SBML Level 1 does not support constraintsNNNWWWW
NoInitialAssignmentsInL1SBML Level 1 does not support initial assignmentsNNNWWWW
NoSpeciesTypesInL1SBML Level 1 does not support species typesNNNWWWN
NoCompartmentTypeInL1SBML Level 1 does not support compartment typesNNNWWWN
NoNon3DCompartmentsInL1SBML Level 1 only supports three-dimensional compartmentsNNEEEEE
NoFancyStoichiometryMathInL1SBML Level 1 does not support non-integer nor non-rational stoichiometry formulasNNEEEEE
NoNonIntegerStoichiometryInL1SBML Level 1 does not support non-integer 'stoichiometry' attribute valuesNNEEEEE
NoUnitMultipliersOrOffsetsInL1SBML Level 1 does not support multipliers or offsets in unit definitionsNNEEEEE
SpeciesCompartmentRequiredInL1In SBML Level 1, a value for 'compartment' is mandatory in species definitionsNNEEEEE
NoSpeciesSpatialSizeUnitsInL1SBML Level 1 does not support species 'spatialSizeUnits' settingsNNEEEEN
NoSBOTermsInL1SBML Level 1 does not support the 'sboTerm' attributeNNNWWWW
StrictUnitsRequiredInL1SBML Level 1 requires strict unit consistencyNNNNNWW
ConversionFactorNotInL1SBML Level 1 does not support the 'conversionFactor' attributeNNNNNNE
CompartmentNotOnL1ReactionSBML Level 1 does not support the 'compartment' attribute on Reaction objectsNNNNNNW
ExtentUnitsNotSubstanceUnits of extent must be compatible with units of substanceNNNNNNE
GlobalUnitsNotDeclaredGlobal units must be refer to unit kind or unitDefinition.NNNNNNE
HasOnlySubstanceUnitsNotinL1The concept of hasOnlySubstanceUnits was not available in SBML Level 1.NNEEEEE
AvogadroNotSupportedAvogadro not supported in Levels 2 and 1.NNNNNNE
NoConstraintsInL2v1SBML Level 2 Version 1 does not support Constraint objectsNNNWWWW
NoInitialAssignmentsInL2v1SBML Level 2 Version 1 does not support InitialAssignment objectsNNNWWWW
NoSpeciesTypeInL2v1SBML Level 2 Version 1 does not support SpeciesType objectsNNNWWWN
NoCompartmentTypeInL2v1SBML Level 2 Version 1 does not support CompartmentType objectsNNNWWWN
NoSBOTermsInL2v1SBML Level 2 Version 1 does not support the 'sboTerm' attributeNNNWWWW
NoIdOnSpeciesReferenceInL2v1SBML Level 2 Version 1 does not support the 'id' attribute on SpeciesReference objectsNNNWWWW
NoDelayedEventAssignmentInL2v1SBML Level 2 Version 1 does not support the 'useValuesFromTriggerTime' attributeNNNNNEE
StrictUnitsRequiredInL2v1SBML Level 2 Version 1 requires strict unit consistencyNNNNNWW
IntegerSpatialDimensionsSBML Level 2 Version 1 requires that compartments have spatial dimensions of 0-3NNNNNNE
StoichiometryMathNotYetSupportedConversion to StoichiometryMath objects not yet supportedNNNNNNN
PriorityLostFromL3SBML Level 2 Version 1 does not support priorities on Event objectsNNNNNNE
NonPersistentNotSupportedSBML Level 2 Version 1 does not support the 'persistent' attribute on Trigger objectsNNNNNNE
InitialValueFalseEventNotSupportedSBML Level 2 Version 1 does not support the 'initialValue' attribute on Trigger objectsNNNNNNE
SBOTermNotUniversalInL2v2The 'sboTerm' attribute is invalid for this component in SBML Level 2 Version 2NNNNWWW
NoUnitOffsetInL2v2This Level+Version of SBML does not support the 'offset' attribute on Unit objectsNNENNNN
NoKineticLawTimeUnitsInL2v2This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objectsEEENNNN
NoKineticLawSubstanceUnitsInL2v2This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objectsEEENNNN
NoDelayedEventAssignmentInL2v2This Level+Version of SBML does not support the 'useValuesFromTriggerTime' attributeNNNNNEE
ModelSBOBranchChangedBeyondL2v2The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+VersionNNNNNEE
StrictUnitsRequiredInL2v2SBML Level 2 Version 2 requires strict unit consistencyNNNNNWW
StrictSBORequiredInL2v2SBML Level 2 Version 2 requires strict SBO term consistencyNNNNNWW
DuplicateAnnotationInvalidInL2v2Duplicate top-level annotations are invalid in SBML Level 2 Version 2WWWNNNN
NoUnitOffsetInL2v3This Level+Version of SBML does not support the 'offset' attribute on Unit objectsNNENNNN
NoKineticLawTimeUnitsInL2v3This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objectsEEENNNN
NoKineticLawSubstanceUnitsInL2v3This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objectsEEENNNN
NoSpeciesSpatialSizeUnitsInL2v3This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objectsNNEENNN
NoEventTimeUnitsInL2v3This Level+Version of SBML does not support the 'timeUnits' attribute on Event objectsNNEENNN
NoDelayedEventAssignmentInL2v3This Level+Version of SBML does not support the 'useValuesFromTriggerTime' attributeNNNNNEE
ModelSBOBranchChangedBeyondL2v3The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+VersionNNNNNEE
StrictUnitsRequiredInL2v3SBML Level 2 Version 3 requires strict unit consistencyNNNNNWW
StrictSBORequiredInL2v3SBML Level 2 Version 3 requires strict SBO term consistencyNNNNNWW
DuplicateAnnotationInvalidInL2v3Duplicate top-level annotations are invalid in SBML Level 2 Version 3WWWNNNN
NoUnitOffsetInL2v4This Level+Version of SBML does not support the 'offset' attribute on Unit objectsNNENNNN
NoKineticLawTimeUnitsInL2v4This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objectsEEENNNN
NoKineticLawSubstanceUnitsInL2v4This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objectsEEENNNN
NoSpeciesSpatialSizeUnitsInL2v4This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objectsNNEENNN
NoEventTimeUnitsInL2v4This Level+Version of SBML does not support the 'timeUnits' attribute on Event objectsNNEENNN
ModelSBOBranchChangedInL2v4The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+VersionNNNEENN
DuplicateAnnotationInvalidInL2v4Duplicate top-level annotations are invalid in SBML Level 2 Version 4WWWNNNN
NoSpeciesTypeInL3v1SBML Level 3 Version 1 does not support SpeciesType objectsNNNWWWN
NoCompartmentTypeInL3v1SBML Level 3 Version 1 does not support CompartmentType objectsNNNWWWN
NoUnitOffsetInL3v1This Level+Version of SBML does not support the 'offset' attribute on Unit objectsNNENNNN
NoKineticLawTimeUnitsInL3v1This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objectsEEENNNN
NoKineticLawSubstanceUnitsInL3v1This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objectsEEENNNN
NoSpeciesSpatialSizeUnitsInL3v1This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objectsNNEENNN
NoEventTimeUnitsInL3v1This Level+Version of SBML does not support the 'timeUnits' attribute on Event objectsNNEENNN
ModelSBOBranchChangedInL3v1The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+VersionNNNEENN
DuplicateAnnotationInvalidInL3v1Duplicate top-level annotations are invalid in SBML Level 3 Version 1WWWNNNN
NoCompartmentOutsideInL3v1This Level+Version of SBML does not support the 'outside' attribute on Compartment objectsWWWWWWN
NoStoichiometryMathInL3v1This Level+Version of SBML does not support the StoichiometryMath objectNNEEEEN
InvalidSBMLLevelVersionUnknown Level+Version combination of SBMLEEEEEEE
AnnotationNotesNotAllowedLevel1Annotation objects on the SBML container element are not permitted in SBML Level 1EENNNNN
InvalidRuleOrderingInvalid ordering of rulesEEENNNN
RequiredPackagePresentThe SBML document requires an SBML Level 3 package unavailable in this softwareNNNNNNE
UnrequiredPackagePresentThe SBML document uses an SBML Level 3 package unavailable in this softwareNNNNNNW
PackageRequiredShouldBeFalseThis package expects required to be false.NNNNNNW
SubsUnitsAllowedInKLDisallowed value for attribute 'substanceUnits' on KineticLaw objectEEENNNN
TimeUnitsAllowedInKLDisallowed value for attribute 'timeUnits' on KineticLaw objectEEENNNN
FormulaInLevel1KLOnly predefined functions are allowed in SBML Level 1 formulasEENNNNN
L3SubstanceUnitsOnModelInvalid 'substanceUnits' attribute valueNNNNNNW
TimeUnitsRemovedThis Level+Version of SBML does not support the 'timeUnits' attribute on Event objectsNNNNEEE
BadMathMLInvalid MathML expressionNNEEEEE
FailedMathMLReadOfDoubleMissing or invalid floating-point number in MathML expressionNNEEEEE
FailedMathMLReadOfIntegerMissing or invalid integer in MathML expressionNNEEEEE
FailedMathMLReadOfExponentialMissing or invalid exponential expression in MathMLNNEEEEE
FailedMathMLReadOfRationalMissing or invalid rational expression in MathMLNNEEEEE
BadMathMLNodeTypeInvalid MathML elementNNEEEEE
NoTimeSymbolInFunctionDefUse of <csymbol> for 'time' not allowed within FunctionDefinition objectsNNWEEEE
NoBodyInFunctionDefThere must be a <lambda> body within the <math> element of a FunctionDefinition objectNNEEEEE
DanglingUnitSIdRefUnits must refer to valid unit or unitDefinitionWWWWWWW
RDFMissingAboutTagRDF missing the <about> tag.NNNWWWW
RDFEmptyAboutTagRDF empty <about> tag.NNNWWWW
RDFAboutTagNotMetaidRDF <about> tag is not metaid.NNNWWWW
RDFNotCompleteModelHistoryRDF does not contain valid ModelHistory.NNNWWWW
RDFNotModelHistoryRDF does not result in a ModelHistory.NNNWWWW
AnnotationNotElementAnnotation must contain element.NNNWWWW
UndeclaredUnitsMissing unit declarations on parameters or literal numbers in expressionWWWWWWW
UndeclaredTimeUnitsL3Unable to verify consistency of units: the unit of time has not been declaredNNNNNNW
UndeclaredExtentUnitsL3Unable to verify consistency of units: the units of reaction extent have not been declaredNNNNNNW
UndeclaredObjectUnitsL3Unable to verify consistency of units: encountered a model entity with no declared unitsNNNNNNW
UnrecognisedSBOTermUnrecognized 'sboTerm' attribute valueNNNWWWW
ObseleteSBOTermObsolete 'sboTerm' attribute valueNNNWWWW
IncorrectCompartmentSpatialDimensionsIn SBML Level 1, only three-dimensional compartments are allowedEENNNNN
CompartmentTypeNotValidAttributeCompartmentType objects are not available in this Level+Version of SBMLEEENNNE
ConstantNotValidAttributeThis Level+Version of SBML does not support the 'constant' attribute on this componentEENNNNN
MetaIdNotValidAttributeAttribute 'metaid' is not available in SBML Level 1EENNNNN
SBOTermNotValidAttributeBeforeL2V3The 'sboTerm' attribute is not available on this component before SBML Level 2 Version 3EEEENNN
InvalidL1CompartmentUnitsInvalid units for a compartment in SBML Level 1EENNNNN
L1V1CompartmentVolumeReqdIn SBML Level 1, a compartment's volume must be specifiedENNNNNN
CompartmentTypeNotValidComponentCompartmentType objects are not available in this Level+Version of SBMLEEENNNE
ConstraintNotValidComponentConstraint objects are not available in this Level+Version of SBMLEEENNNN
EventNotValidComponentEvent objects are not available in this Level+Version of SBMLEENNNNN
SBOTermNotValidAttributeBeforeL2V2The 'sboTerm' attribute is invalid for this component before Level 2 Version 2EEENNNN
FuncDefNotValidComponentFunctionDefinition objects are not available in this Level+Version of SBMLEENNNNN
InitialAssignNotValidComponentInitialAssignment objects are not available in this Level+Version of SBMLEEENNNN
VariableNotValidAttributeAttribute 'variable' is not available on this component in this Level+Version of SBMLEEEEEEE
UnitsNotValidAttributeAttribute 'units' is not available on this component in this Level+Version of SBMLEEEEEEE
ConstantSpeciesNotValidAttributeAttribute 'constant' is not available on Species objects in SBML Level 1EENNNNN
SpatialSizeUnitsNotValidAttributeAttribute 'spatialSizeUnits' is not available on Species objects in SBML Level 1EENNNNN
SpeciesTypeNotValidAttributeAttribute 'speciesType' is not available on Species objects in SBML Level 1EEENNNE
HasOnlySubsUnitsNotValidAttributeAttribute 'hasOnlySubstanceUnits' is not available on Species objects in SBML Level 1EENNNNN
IdNotValidAttributeAttribute 'id' is not available on SpeciesReference objects in SBML Level 1EEENNNN
NameNotValidAttributeAttribute 'name' is not available on SpeciesReference objects in SBML Level 1EEENNNN
SpeciesTypeNotValidComponentThe SpeciesType object is not supported in SBML Level 1EEENNNE
StoichiometryMathNotValidComponentThe StoichiometryMath object is not supported in SBML Level 1EENNNNE
MultiplierNotValidAttributeAttribute 'multiplier' on Unit objects is not supported in SBML Level 1EENNNNN
OffsetNotValidAttributeAttribute 'offset' on Unit objects is only available in SBML Level 2 Version 1EENNNNN
L3SpatialDimensionsUnsetNo value given for 'spatialDimensions' attribute; assuming a value of 3NNNNNNW
PackageConversionNotSupportedConversion of SBML Level 3 package constructs is not yet supportedEEEEEEE
InvalidTargetLevelVersionThe requested SBML Level/Version combination is not known to existEEEEEEE
L3NotSupportedSBML Level 3 is not yet supportedEEEEEEE

SBMLErrorCategory_t

SBMLErrorCategory_t is an enumeration of category codes for SBMLError diagnostics. The category can be retrieved from an SBMLError object using the method SBMLError::getCategory(). These enumeration values are distinct from (and in addition to) the XMLErrorCategory_t codes used by the parent XMLError object. User programs receiving an SBMLError object can use this distinction to check whether the error represents a low-level XML problem or an SBML problem.

The following table lists each possible value and a brief description of its meaning.

Enumerator Meaning
LIBSBML_CAT_SBMLGeneral error not falling into another category below.
LIBSBML_CAT_SBML_L1_COMPATCategory of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model from SBML Level 2 to SBML Level 1.
LIBSBML_CAT_SBML_L2V1_COMPATCategory of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 1.
LIBSBML_CAT_SBML_L2V2_COMPATCategory of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 2.
LIBSBML_CAT_GENERAL_CONSISTENCYCategory of errors that can occur while validating general SBML constructs. With respect to the SBML specification, these concern failures in applying the validation rules numbered 2xxxx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.
LIBSBML_CAT_IDENTIFIER_CONSISTENCYCategory of errors that can occur while validating symbol identifiers in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 103xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.
LIBSBML_CAT_UNITS_CONSISTENCYCategory of errors that can occur while validating the units of measurement on quantities in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 105xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.
LIBSBML_CAT_MATHML_CONSISTENCYCategory of errors that can occur while validating MathML formulas in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 102xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.
LIBSBML_CAT_SBO_CONSISTENCYCategory of errors that can occur while validating SBO identifiers in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 107xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.
LIBSBML_CAT_OVERDETERMINED_MODELError in the system of equations in the model: the system is overdetermined, therefore violating a tenet of proper SBML. With respect to the SBML specification, this is validation rule #10601 in the SBML Level 2 Versions 2–4 and Level 3 Version 1 specifications.
LIBSBML_CAT_SBML_L2V3_COMPATCategory of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 3.
LIBSBML_CAT_MODELING_PRACTICECategory of warnings about recommended good practices involving SBML and computational modeling. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)
LIBSBML_CAT_INTERNAL_CONSISTENCYCategory of errors that can occur while validating libSBML's internal representation of SBML constructs. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)
LIBSBML_CAT_SBML_L2V4_COMPATCategory of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 4.
LIBSBML_CAT_SBML_L3V1_COMPAT

Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 3 Version 1.

SBMLErrorSeverity_t

This is an enumeration of severity codes for SBMLError diagnostics. User programs receiving an SBMLError object can use this distinction to check whether the error represents a low-level XML problem or an SBML problem.

In libSBML version 5.8.0 there are no additional severity codes in SBMLErrorSeverity_t beyond those defined in XMLErrorSeverity_t.


Public Member Functions

unsigned int getCategory () const
 Returns the category of this error. More...
 
const std::string & getCategoryAsString () const
 Returns a string describing the category of this error. More...
 
unsigned int getColumn () const
 Returns the column number in the XML input near where the error, warning or other diagnostic occurred. More...
 
unsigned int getErrorId () const
 Returns the identifier of this error. More...
 
unsigned int getErrorIdOffset () const
 
unsigned int getLine () const
 Returns the line number in the XML input near where the error, warning or other diagnostic occurred. More...
 
const std::string & getMessage () const
 Returns the message text of this error. More...
 
const std::string & getPackage () const
 
unsigned int getSeverity () const
 Returns the severity of this error. More...
 
const std::string & getSeverityAsString () const
 Returns a string describing the severity level of this error. More...
 
const std::string & getShortMessage () const
 Returns a brief message for this error. More...
 
bool isError () const
 Predicate returning true or false depending on whether this error is a significant error. More...
 
bool isFatal () const
 Predicate returning true or false depending on whether this error is a fatal run-time error. More...
 
bool isInfo () const
 Predicate returning true or false depending on whether this error object is for information purposes only. More...
 
bool isInternal () const
 Predicate returning true or false depending on whether this error resulted from an internal program error. More...
 
bool isSystem () const
 Predicate returning true or false depending on whether this error was generated by the operating system. More...
 
bool isValid () const
 Predicate returning true or false depending on whether this error resulted from a problem or whether it was logged as an unknown error. More...
 
bool isWarning () const
 Predicate returning true or false depending on whether this error object is a warning. More...
 
bool isXML () const
 Predicate returning true or false depending on whether this error resulted from a problem in the XML input (e.g., an XML syntax error). More...
 
 SBMLError (const unsigned int errorId=0, const unsigned int level=SBML_DEFAULT_LEVEL, const unsigned int version=SBML_DEFAULT_VERSION, const std::string &details="", const unsigned int line=0, const unsigned int column=0, const unsigned int severity=LIBSBML_SEV_ERROR, const unsigned int category=LIBSBML_CAT_SBML, const std::string &package="core", const unsigned int pkgVersion=1)
 Creates a new SBMLError to report that something occurred during SBML processing. More...
 
 SBMLError (const SBMLError &orig)
 Copy constructor; creates a copy of this SBMLError. More...
 
int setColumn (unsigned int column)
 Sets the column number where this error occurred. More...
 
int setLine (unsigned int line)
 Sets the line number where this error occurred. More...
 

Static Public Member Functions

static const std::string getStandardMessage (const int code)
 Returns a copy of the message string associated with the given predefined XMLError code. More...
 

Constructor & Destructor Documentation

SBMLError::SBMLError ( const unsigned int  errorId = 0,
const unsigned int  level = SBML_DEFAULT_LEVEL,
const unsigned int  version = SBML_DEFAULT_VERSION,
const std::string &  details = "",
const unsigned int  line = 0,
const unsigned int  column = 0,
const unsigned int  severity = LIBSBML_SEV_ERROR,
const unsigned int  category = LIBSBML_CAT_SBML,
const std::string &  package = "core",
const unsigned int  pkgVersion = 1 
)

Creates a new SBMLError to report that something occurred during SBML processing.

When a libSBML operation on SBML content results in a warning, error or other diagnostic, the issue is reported as an SBMLError object. SBMLError objects have identification numbers to indicate the nature of the exception. These numbers are drawn from the enumeration SBMLErrorCode_t. The argument errorId to this constructor can be (but does not have to be) a value from this enumeration. If it is a value from SBMLErrorCode_t, the SBMLError class assumes the error is a low-level system or SBML layer error and prepends a built-in, predefined error message to any string passed in the argument details to this constructor. In addition, all SBMLErrorCode_t errors have associated values for the severity and category codes, and these fields are filled-in as well from the enumerations SBMLErrorSeverity_t and SBMLErrorCategory_t, respectively.

If the error identifier errorId is a number greater than 99999, the SBMLError class assumes the error was generated from another part of the software and does not do additional filling in of values beyond the default in the constructor itself. This allows SBMLError to serve as a base class for other errors, such as for user-defined validation rules (see Validator). Callers should fill in all the parameters with suitable values if generating errors with codes greater than 99999 to make maximum use of the SBMLError facilities.

As mentioned above, there are two other enumerations, SBMLErrorSeverity_t and SBMLErrorCategory_t, used for indicating the severity and category of error for the predefined SBMLError codes. The values passed in severity and category override the defaults assigned based on the error code. If the value of errorId is a value from SBMLErrorCode_t, callers do not need to fill in severity and category. Conversely, if errorId is not a value from SBMLErrorCode_t, callers can use other values (not just those from SBMLErrorSeverity_t and SBMLErrorCategory_t, but their own special values) for severity and category.

Please see the top of the documentation for SBMLError for a longer discussion of the possible error codes, their meanings, and their applicability to different combinations of Level+Version of SBML.

Parameters
errorIdan unsigned int, the identification number of the error.
levelthe SBML Level of the SBML model
versionthe SBML Version within the Level of the SBML model
detailsa string containing additional details about the error. If the error code in errorId is one that is recognized by SBMLError, the given message is appended to a predefined message associated with the given code. If the error code is not recognized, the message is stored as-is as the text of the error.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
severityan integer indicating severity of the error.
categoryan integer indicating the category to which the error belongs.
packagethe SBML Level package involved.
pkgVersionthe version of the package.
SBMLError::SBMLError ( const SBMLError orig)

Copy constructor; creates a copy of this SBMLError.

Member Function Documentation

unsigned int XMLError::getCategory ( ) const
inherited

Returns the category of this error.

XMLError defines an enumeration of category codes for the XML layer. Applications that build on XMLError by subclassing it may add their own categories with numbers higher than those in the predefined set of category codes.

Categories can be used to partition errors into distinct groups. Among other things, this can be used to prevent id conflicts by uniquely identifying an XMLError by both id and category.

Returns
the category of this XMLError.
See Also
getSeverity()
getCategoryAsString()
const std::string & XMLError::getCategoryAsString ( ) const
inherited

Returns a string describing the category of this error.

XMLError defines an enumeration of category codes for the XML layer. Applications that build on XMLError by subclassing it may add their own categories with numbers higher than those in the predefined set of category codes.

Categories can be used to partition errors into distinct groups. Among other things, this can be used to prevent id conflicts by uniquely identifying an XMLError by both id and category.

Returns
string representing the category of this XMLError.
See Also
getCategory()
getSeverityAsString()
unsigned int XMLError::getColumn ( ) const
inherited

Returns the column number in the XML input near where the error, warning or other diagnostic occurred.

We say "near where the problem occurred", because many factors affect how accurate the line/column information ultimately is. For example, sometimes, the underlying XML parsers can only report such information for the parent XML element where an error occurs, and not for the specific point where the problem occurs. In other situations, some parsers report invalid line and/or column numbers altogether. If this occurs, libSBML sets the line and/or column number in the XMLError object to either 0 or the value of the maximum unsigned long integer representable on the platform where libSBML is running. The probability that a true line or column number in an SBML model would equal this value is vanishingly small; thus, if an application encounters these values in an XMLError object, it can assume no valid line/column number could be provided by libSBML in that situation.

Returns
the column number
See Also
getLine()
unsigned int XMLError::getErrorId ( ) const
inherited

Returns the identifier of this error.

Returns
the error code for this error.
See Also
getMessage()
getShortMessage()
getCategory()
getSeverity()
unsigned int XMLError::getErrorIdOffset ( ) const
inherited
unsigned int XMLError::getLine ( ) const
inherited

Returns the line number in the XML input near where the error, warning or other diagnostic occurred.

We say "near where the problem occurred", because many factors affect how accurate the line/column information ultimately is. For example, sometimes, the underlying XML parsers can only report such information for the parent XML element where an error occurs, and not for the specific point where the problem occurs. In other situations, some parsers report invalid line and/or column numbers altogether. If this occurs, libSBML sets the line and/or column number in the XMLError object to either 0 or the value of the maximum unsigned long integer representable on the platform where libSBML is running. The probability that a true line or column number in an SBML model would equal this value is vanishingly small; thus, if an application encounters these values in an XMLError object, it can assume no valid line/column number could be provided by libSBML in that situation.

Returns
the line number
See Also
getColumn()
const string & XMLError::getMessage ( ) const
inherited

Returns the message text of this error.

The message associated with an error object describes the nature of the problem. The message returned by this method is generally longer and clearer than the message returned by XMLError::getShortMessage(), but not in all cases.

Callers may use XMLError::getCategory() and XMLError::getSeverity() to obtain additional information about the nature and severity of the problem.

Returns
the message text
See Also
getErrorId()
getShortMessage()
getCategory()
getSeverity()
const std::string & XMLError::getPackage ( ) const
inherited
unsigned int XMLError::getSeverity ( ) const
inherited

Returns the severity of this error.

XMLError defines an enumeration of severity codes for the XML layer. Applications that build on XMLError by subclassing it may add their own severity codes with numbers higher than those in the predefined set of severity codes.

Returns
the severity of this XMLError.
See Also
getSeverityAsString()
getCategory()
const std::string & XMLError::getSeverityAsString ( ) const
inherited

Returns a string describing the severity level of this error.

XMLError defines an enumeration of severity codes for the XML layer. Applications that build on XMLError by subclassing it may add their own severity codes with numbers higher than those in the predefined set of severity codes.

Returns
string representing the severity of this XMLError.
See Also
getSeverity()
getCategoryAsString()
const string & XMLError::getShortMessage ( ) const
inherited

Returns a brief message for this error.

This is an alternative error message that, in general, is as short as the authors could make it. However, brevity is often inversely proportional to clarity, so this short message may not be sufficiently informative to understand the nature of the error. Calling applications may wish to check XMLError::getMessage() in addition or instead.

Returns
the short error message text
See Also
getErrorId()
getMessage()
getCategory()
getSeverity()
const string XMLError::getStandardMessage ( const int  code)
staticinherited

Returns a copy of the message string associated with the given predefined XMLError code.

Parameters
codethe error code whose message is sought; it must be a predefined value from XMLErrorCode_t.
bool XMLError::isError ( ) const
inherited

Predicate returning true or false depending on whether this error is a significant error.

This is equivalent to obtaining the severity code from an XMLError object (via XMLError::getSeverity()) and then comparing it to the value LIBSBML_SEV_ERROR from the enumeration XMLErrorSeverity_t.

Returns
true if this error is an error, false otherwise.
See Also
isInfo()
isWarning()
isFatal()
bool XMLError::isFatal ( ) const
inherited

Predicate returning true or false depending on whether this error is a fatal run-time error.

This is equivalent to obtaining the severity code from an XMLError object (via XMLError::getSeverity()) and then comparing it to the value LIBSBML_SEV_FATAL from the enumeration XMLErrorSeverity_t.

Returns
true if this error is a fatal error, false otherwise.
See Also
isInfo()
isWarning()
isError()
bool XMLError::isInfo ( ) const
inherited

Predicate returning true or false depending on whether this error object is for information purposes only.

This is equivalent to obtaining the severity code from an XMLError object (via XMLError::getSeverity()) and then comparing it to the value LIBSBML_SEV_INFO from the enumeration XMLErrorSeverity_t.

Returns
true if this XMLError is for informational purposes only, false otherwise.
See Also
isWarning()
isError()
isFatal()
bool XMLError::isInternal ( ) const
inherited

Predicate returning true or false depending on whether this error resulted from an internal program error.

This is equivalent to obtaining the category identifier from an XMLError object (via XMLError::getCategory()) and then comparing it to the value LIBSBML_CAT_INTERNAL from the enumeration XMLErrorCategory_t.

Returns
true or false
See Also
isSystem()
isXML()
bool XMLError::isSystem ( ) const
inherited

Predicate returning true or false depending on whether this error was generated by the operating system.

This is equivalent to obtaining the category identifier from an XMLError object (via XMLError::getCategory()) and then comparing it to the value LIBSBML_CAT_SYSTEM from the enumeration XMLErrorCategory_t.

Returns
true or false
See Also
isInternal()
isXML()
bool XMLError::isValid ( ) const
inherited

Predicate returning true or false depending on whether this error resulted from a problem or whether it was logged as an unknown error.

This is equivalent to obtaining the error identifier from an XMLError object (via XMLError::getErrorId()) and then comparing it to the value XMLUnknownError or UnknownError from the enumeration XMLErrorCode_t.

Returns
true or false
bool XMLError::isWarning ( ) const
inherited

Predicate returning true or false depending on whether this error object is a warning.

This is equivalent to obtaining the severity code from an XMLError object (via XMLError::getSeverity()) and then comparing it to the value LIBSBML_SEV_WARNING from the enumeration XMLErrorSeverity_t.

Returns
true if this error is a warning, false otherwise.
See Also
isInfo()
isError()
isFatal()
bool XMLError::isXML ( ) const
inherited

Predicate returning true or false depending on whether this error resulted from a problem in the XML input (e.g., an XML syntax error).

This is equivalent to obtaining the category identifier from an XMLError object (via XMLError::getCategory()) and then comparing it to the value LIBSBML_CAT_XML from the enumeration XMLErrorCategory_t.

Returns
true or false
See Also
isInternal()
isSystem()
int XMLError::setColumn ( unsigned int  column)
inherited

Sets the column number where this error occurred.

Parameters
columnan unsigned int, the column number to set.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See Also
setLine(unsigned int line)
int XMLError::setLine ( unsigned int  line)
inherited

Sets the line number where this error occurred.

Parameters
linean unsigned int, the line number to set.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See Also
setColumn(unsigned int column)