Package pygeodesy :: Module errors |
[frames] | no frames]

# Module errors

Error, exception classes and functions to format PyGeodesy errors, including the setting of exception chaining in Python 3+.

By default, exception chaining is turned off. Set environment variable `PYGEODESY_EXCEPTION_CHAINING` to 'std' or any other non-empty string to enable exception chaining.

Version: 20.05.15

Classes
| CrossError Error raised for zero or near-zero vectorial cross products, occurring for coincident or colinear points, paths or bearings.
| LenError Error raised for mis-matching `len` values.
| LimitError Error raised for lat- or longitudinal deltas exceeding the `limit` in functions equirectangular and equirectangular_ and `nearestOn*` and `simplify*` functions or methods.
| RangeError Error raised for lat- or longitude values outside the `clip`, `clipLat`, `clipLon` or `limit` range in function clipDegrees, clipRadians, parse3llh, parseDMS, parseDMS2 or parseRad.

Functions
crosserrors(raiser=None) Report or ignore vectorial cross product errors. |
exception_chaining(error=None) Get the previous exception or exception chaining setting. |
limiterrors(raiser=None) Get/set the throwing of LimitErrors. |
rangerrors(raiser=None) Get/set the throwing of RangeErrors. |

Variables
| __all__ = `_ALL_LAZY.errors`
| _ = `Exception().__cause__`

Function Details

### crosserrors (raiser=None) |
Report or ignore vectorial cross product errors. Arguments: `raiser` - Use `True` to throw or `False` to ignore CrossError exceptions. Use `None` to leave the setting unchanged. Returns: Previous setting (`bool`). See Also: Property `Vector3d.crosserrors`.

### exception_chaining (error=None) |
Get the previous exception or exception chaining setting. Arguments: `error` - An error instance (`Exception`) or `None`. Returns: If `error=None`, return `True` if exception chaining is enabled for PyGeodesy errors, `False` if turned off and `None` if not available. If `error` is not `None`, return the previous, chained error or `None` otherwise.

### limiterrors (raiser=None) |
Get/set the throwing of LimitErrors. Arguments: `raiser` - Choose `True` to raise or `False` to ignore LimitError exceptions. Use `None` to leave the setting unchanged. Returns: Previous setting (`bool`).

### rangerrors (raiser=None) |
Get/set the throwing of RangeErrors. Arguments: `raiser` - Choose `True` to raise or `False` to ignore RangeError exceptions. Use `None` to leave the setting unchanged. Returns: Previous setting (`bool`).