Source code for metapub.exceptions

from lxml.etree import XMLSyntaxError


[docs] class MetaPubError(Exception): """Base Exception class from which all other exceptions in this library derive.""" pass
[docs] class BaseXMLError(MetaPubError): """Raised when XML needed to instantiate an object fails at the most basic level."""
[docs] class InvalidPMID(MetaPubError): """Raised when NCBI efetch of a pubmed ID results in "invalid" response."""
[docs] class InvalidBookID(MetaPubError): """Raised when attempting to lookup an NCBI book with something that doesn't look like a Book ID."""
[docs] class CrossRefConnectionError(MetaPubError): """Raised when a well-formed CrossRef query results in a server error."""
[docs] class AccessDenied(NoPDFLink): """Raised when a FindIt url lookup fails for some specific reason that is particular to the journal or publisher."""
[docs] class BadDOI(MetaPubError): """Raised when DxDOI class tests validity of DOI and it fails to pass muster."""
[docs] class DxDOIError(MetaPubError): """Raised when a bad status code comes from loading dx.doi.org"""