xbrl.Error¶
An xbrl.Error class represents a single error reported during the validation process of the current job.
Base class: xml.Error
Nested classes: xbrl.Error.ExternalLinkParam, xbrl.Error.Param
- class xbrl.Error¶
Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a
NotImplementedErrorexception.
Class methods¶
- classmethod xbrl.Error.create(type cls, msg, severity=xml.ErrorSeverity.ERROR, error_code=None, reference=None, location=0, children=None, **params)¶
Constructs a new
xml.Errorobject with the given text message. Placeholders for dynamic content can be inserted in the message string using the parameter name in curly braces. Parameters can be of type string,xml.InformationItem,xsd.Componentor other objects representing XML information items or XSD schema components like XBRL concepts or facts.A string can be passed to the optional ‘error_code’ argument to set the error code or name. An URI string can be passed to the optional ‘reference’ argument to identify a specific part of the specification which has been violated. An xml.ErrorSeverity enumeration value can be passed to the optional ‘severity’ argument. Errors of type xml.ErrorSeverity.ERROR will cause the result of the current validation job to be set to ‘Failed’. An
xsd.Componentorxml.InformationItemobject or a string with an absolute URI can be passed to the optional ‘location’ argument to specify the XML location of the error. A list of child errors can be passed to the optional ‘children’ argument. For each placeholder in the message an argument with the same name should be supplied.Example:
job.error_log.report(Error.create(‘Value {val} for fact {fact} is not allowed!’, location=fact, val=fact.normalized_value, fact=fact))
Attributes¶
- xml.Error.children
Returns an iterator of
xml.Errorobjects for each child error of this error.
- xml.Error.error_code
Returns the error code (name) of this error.
- xml.Error.error_qname
Returns the qualified name of this error.
- xml.Error.main_line
Returns the textual representation of the main line as a string.
- xml.Error.severity
Returns the error severity as an xml.ErrorSeverity enumaration.
- xml.Error.text
Returns the textual representation of the full error message as a string.
Special methods¶
__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__