Errors¶
These are the exceptions thrown by Ferenda. Any of the python built-in exceptions may be thrown as well, but exceptions in used third-party libraries should be wrapped in one of these.
-
exception
ferenda.errors.FerendaException[source]¶ Base class for anything that can go wrong in ferenda.
-
exception
ferenda.errors.DownloadError[source]¶ Raised when a download fails in a non-recoverable way.
-
exception
ferenda.errors.DownloadFileNotFoundError[source]¶ Raised when we had indication that a particular document should exist (we have a basefile for it) but on closer examination, it turns that it doesn’t exist after all. This is used when we can’t raise a requests.exceptions.HTTPError 404 error for some reason.
-
exception
ferenda.errors.FSMStateError[source]¶ Raised whenever the current state and the current symbol in a
FSMParserconfiguration does not have a defined transition.
-
exception
ferenda.errors.DocumentRemovedError(value='', dummyfile=None)[source]¶ Raised whenever a particular document has been found to be removed – this can happen either during
download()orparse()(which may be the case if there exists a physical document, but whose contents are essentially a placeholder saying that the document has been removed).You can set the attribute
dummyfileon this exception when raising it, preferably to the parsed_path that would be created, if not this exception had occurred.. If present,ferenda-build.py(or ratherferenda.manager.run()) will use this to create a dummy file at the indicated path. This prevents endless re-parsing of expired documents.
-
exception
ferenda.errors.DocumentSkippedError(value='', dummyfile=None)[source]¶ Raised if the document should not be processed (even though it may exist) since it’s not interesting.
-
exception
ferenda.errors.DocumentRenamedError(value, returnvalue, oldbasefile, newbasefile)[source]¶
-
exception
ferenda.errors.PatchError[source]¶ Raised if a patch cannot be applied by
patch_if_needed().
-
exception
ferenda.errors.NoDownloadedFileError[source]¶ Raised on an attempt to parse a basefile for which there doesn’t exist a downloaded file.
-
exception
ferenda.errors.InvalidTree[source]¶ Raised when the parsed XHTML tree fails internal validation.
-
exception
ferenda.errors.AttachmentNameError[source]¶ Raised whenever an invalid attachment name is used with any method of
DocumentStore.
-
exception
ferenda.errors.AttachmentPolicyError[source]¶ Raised on any attempt to store an attachment using
DocumentStorewhenstorage_policyis not set todir.
-
exception
ferenda.errors.ArchivingError[source]¶ Raised whenever an attempt to archive a document version using
archive()fails (for example, because the archive version already exists).
-
exception
ferenda.errors.ValidationError[source]¶ Raised whenever a created document doesn’t validate using the appropriate schema.
-
exception
ferenda.errors.TransformError[source]¶ Raised whenever a XSLT transformation fails for any reason.
-
exception
ferenda.errors.ExternalCommandError[source]¶ Raised whenever any invocation of an external commmand fails for any reason.
-
exception
ferenda.errors.ExternalCommandNotFound[source]¶ Raised whenever any invocation of an external commmand fails
-
exception
ferenda.errors.ConfigurationError[source]¶ Raised when a configuration file cannot be found in it’s expected location or when it cannot be used due to corruption, file permissions or other reasons
-
exception
ferenda.errors.TriplestoreError[source]¶ Raised whenever communications with the triple store fails, for whatever reason.
-
exception
ferenda.errors.SparqlError[source]¶ Raised whenever a SPARQL query fails. The Exception should contain whatever error message that the Triple store returned, so the exact formatting may be dependent on which store is used.
-
exception
ferenda.errors.IndexingError[source]¶ Raised whenever an attempt to put text into the fulltext index fails.
-
exception
ferenda.errors.SearchingError[source]¶ Raised whenever an attempt to do a full-text search fails.
-
exception
ferenda.errors.SchemaConflictError[source]¶ Raised whenever a fulltext index is opened with repo arguments that result in a different schema than what’s currently in use. Workaround this by removing the fulltext index and recreating.
-
exception
ferenda.errors.SchemaMappingError[source]¶ Raised whenever a given field in a schema cannot be mapped to or from the underlying native field object in an actual fulltextindex store.
-
exception
ferenda.errors.MaxDownloadsReached[source]¶ Raised whenever a recursive download operation has reached a globally set maximum number of requests.
-
exception
ferenda.errors.ResourceNotFound[source]¶ Raised when
ResourceLoadermethod is called with the name of a non-existing resource.
-
exception
ferenda.errors.PDFFileIsEmpty[source]¶ Raised when
converttries to parse the textual content of a PDF, but finds that it has no text information (maybe because it only contains scanned images).