bolster.exceptions

Bolster domain-specific exception hierarchy.

This module provides the constitutional exception hierarchy for all data source modules. All data sources MUST use these domain-specific exceptions instead of generic Exception.

Attributes

NISRADataNotFoundError

NISRAValidationError

PSNIDataNotFoundError

PSNIValidationError

Exceptions

DataSourceError

Base class for all data source errors.

DataNotFoundError

Raised when expected data publications or URLs are not found.

ValidationError

Raised when data fails integrity validation checks.

ParseError

Raised when file or data parsing fails.

NetworkError

Raised when network operations fail beyond retry limits.

Module Contents

exception bolster.exceptions.DataSourceError[source]

Bases: Exception

Base class for all data source errors.

This is the root exception for all domain-specific errors in Bolster. All other exceptions should inherit from this base class.

Initialize self. See help(type(self)) for accurate signature.

exception bolster.exceptions.DataNotFoundError(message, url=None, source=None)[source]

Bases: DataSourceError

Raised when expected data publications or URLs are not found.

Examples

  • Publication page returns 404

  • Expected Excel file link missing from page

  • RSS feed returns no entries

  • API endpoint returns empty response

Parameters:
  • message (str) – Description of what data was not found

  • url (str) – Optional URL that was being accessed

  • source (str) – Optional data source identifier

Initialize DataSourceError with message and optional context.

url = None[source]
source = None[source]
__str__()[source]

Return str(self).

exception bolster.exceptions.ValidationError(message, data_info=None, validation_type=None)[source]

Bases: DataSourceError

Raised when data fails integrity validation checks.

Examples

  • Required columns missing from DataFrame

  • Data values outside expected ranges

  • Inconsistent data relationships

  • Empty datasets when data expected

Parameters:
  • message (str) – Description of validation failure

  • data_info (str) – Optional info about the problematic data

  • validation_type (str) – Optional type of validation that failed

Initialize ValidationError with message and optional validation context.

data_info = None[source]
validation_type = None[source]
__str__()[source]

Return str(self).

exception bolster.exceptions.ParseError(message, file_path=None, parser_type=None)[source]

Bases: DataSourceError

Raised when file or data parsing fails.

Examples

  • Malformed Excel file structure

  • Unexpected CSV format

  • HTML parsing issues

  • JSON decode errors

Parameters:
  • message (str) – Description of parsing failure

  • file_path (str) – Optional path to file that failed to parse

  • parser_type (str) – Optional type of parser (excel, csv, html, json)

Initialize ParseError with message and optional parsing context.

file_path = None[source]
parser_type = None[source]
__str__()[source]

Return str(self).

exception bolster.exceptions.NetworkError(message, url=None, status_code=None, retry_count=None)[source]

Bases: DataSourceError

Raised when network operations fail beyond retry limits.

Examples

  • Timeout errors after retries

  • Connection refused

  • DNS resolution failures

  • Server returning persistent errors (500, 503)

Parameters:
  • message (str) – Description of network failure

  • url (str) – Optional URL that failed

  • status_code (int) – Optional HTTP status code

  • retry_count (int) – Optional number of retries attempted

Initialize NetworkError with message and optional network context.

url = None[source]
status_code = None[source]
retry_count = None[source]
__str__()[source]

Return str(self).

bolster.exceptions.NISRADataNotFoundError[source]
bolster.exceptions.NISRAValidationError[source]
bolster.exceptions.PSNIDataNotFoundError[source]
bolster.exceptions.PSNIValidationError[source]