mangadap.util.exception_tools module

Provides a set of tools that the MaNGA DAP uses to handle/report raised exceptions.

License:
Copyright (c) 2015, SDSS-IV/MaNGA Pipeline Group
Licensed under BSD 3-clause license - see LICENSE.rst
Source location:
$MANGADAP_DIR/python/mangadap/util/exception_tools.py
Imports and python version compliance:
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

import sys
if sys.version > '3':
    long = int

import inspect
from os import environ
Revision history:
2015: Original implementation by K. Westfall (KBW)
20 May 2015: (KBW) Documentation and Sphinx tests
03 Feb 2016: (KBW) Added check_environment_variable()
mangadap.util.exception_tools.check_environment_variable(name)[source]

Check for the existence of an environment variable.

Parameters:name (str) – Name of a required environmental variable
Raises:EnvironmentError – Raised if name is not defined.
mangadap.util.exception_tools.print_frame(prefix)[source]

Print the frame stack.

Parameters:prefix (str) – Prefix (typically the exception type) for the printed statement