Overview
Thebormeparser.exceptions module defines custom exception classes for handling various error conditions when working with BORME data. All exceptions inherit from the base BormeparserException class.
Exception Hierarchy
BormeparserException
Base exception class for all bormeparser-specific exceptions.Usage
This is the base exception that all other bormeparser exceptions inherit from. You can catch this to handle any bormeparser-related error.BormeIOErrorException
Raised when an I/O error occurs while reading or writing BORME files.When it’s raised
- File system errors when reading BORME XML or PDF files
- Permission errors when accessing BORME directories
- Disk I/O failures
Example
BormeDoesntExistException
Raised when attempting to access a BORME publication that doesn’t exist.When it’s raised
- Requesting a BORME for a date when no publication was issued (e.g., weekends, holidays)
- Accessing BORME data for dates before the system started publishing
- Invalid date ranges
Example
BormeAlreadyDownloadedException
Raised when attempting to download a BORME file that has already been downloaded.When it’s raised
- Calling download methods when the file already exists locally
- Duplicate download attempts
Example
BormeInvalidActoException
Raised when an invalid or unrecognized acto (action/event type) is encountered.When it’s raised
- Processing BORME data with unknown acto types
- Malformed acto names in BORME publications
- Attempting to filter by non-existent acto types
Example
BormeInvalidCargoException
Raised when an invalid or unrecognized cargo (position/role) is encountered.When it’s raised
- Processing BORME data with unknown cargo types
- Malformed cargo names in BORME publications
- Attempting to filter by non-existent cargo types
Example
BormeAnuncioNotFound
Raised when a specific BORME anuncio (announcement) cannot be found.When it’s raised
- Searching for a non-existent announcement ID
- Accessing announcements that have been removed or are not in the dataset
- Invalid announcement references