Errors#

Custom exceptions for the osbng package.

These exceptions are intended to provide clear and specific error handling for scenarios where invalid inputs or operations are encountered.

Custom exceptions:

  • BNGExtentError: Raised when easting and northing coordinates fall outside of the BNG index system extent.

  • BNGHierarchyError: Raised when an invalid parent or child derivation is attempted.

  • BNGNeighbourError: Raised when an invalid neighbour relationship is encountered.

  • BNGReferenceError: Raised when an invalid BNG reference string is provided.

  • BNGResolutionError: Raised when an invalid BNG resolution is provided.

exception osbng.errors.BNGExtentError[source]#

Bases: Exception

Initialise exception with a message listing the valid coordinate ranges.

exception osbng.errors.BNGHierarchyError[source]#

Bases: Exception

Raised for invalid parent/child derivation.

exception osbng.errors.BNGNeighbourError[source]#

Bases: Exception

Raised for invalid neighbour relationships.

exception osbng.errors.BNGReferenceError[source]#

Bases: Exception

Raised for invalid BNG reference strings.

exception osbng.errors.BNGResolutionError[source]#

Bases: Exception

Initialise exception with a message listing supported resolutions.