2.1.3.1.1. sf_tools.interface.errors module

ERROR HANDLING ROUTINES

This module contains methods for handing warnings and errors.

Author:Samuel Farrens <samuel.farrens@gmail.com>
Version:1.2
Date:23/10/2017
sf_tools.interface.errors.warn(warn_string, log=None)[source]

Warning

This method creates custom warning messages.

Parameters:
  • warn_string (str) – Warning message string
  • log (instance, optional) – Logging structure instance
sf_tools.interface.errors.catch_error(exception, log=None)[source]

Catch error

This method catches errors and prints them to the terminal. It also saves the errors to a log if provided.

Parameters:
  • exception (str) – Exception message string
  • log (instance, optional) – Logging structure instance
sf_tools.interface.errors.file_name_error(file_name)[source]

File name error

This method checks if the input file name is valid.

Parameters:file_name (str) – File name string
Raises:IOError – If file name not specified or file not found