src.pydasa.validations.error#

General error handling utilities for PyDASA.

Functions#

handle_error(ctx, func, exc)

Generic function to handle errors across the whole PyDASA library.

inspect_var(var)

generic function to inspect a variable an gets its name in the source code.

Module Contents#

src.pydasa.validations.error.handle_error(ctx, func, exc)#

Generic function to handle errors across the whole PyDASA library.

Parameters:
  • ctx (str) – The context (e.g., package/class) where the error occurred.

  • func (str) – The name of the function or method where the error occurred.

  • exc (Exception) – The exception that was raised.

Raises:
  • TypeError – If the context is not a string.

  • TypeError – If the function name is not a string.

  • TypeError – If the exception is not an instance of Exception.

  • type – If the error message is not a string.

Return type:

None

src.pydasa.validations.error.inspect_var(var)#

generic function to inspect a variable an gets its name in the source code.

Parameters:

var (Any) – The variable to inspect.

Returns:

The name of the variable.

Return type:

str

Raises:

ValueError – If the variable name cannot be found in the current scope.