grapa.shared.error_management

Utility exceptions and warnings for grapa Concept: The API generates custom exceptions and warnings.

  • Exceptions are what prevents a graph to be drawn or saved. Plotting is interrupted. Custom classes based on GrapaError for later filtering

  • Lesser issues e.g. incorrect input in a plot property result in warnings Custom category based on GrapaWarning for later filtering

  • A log file (grapalog.log) registers exceptions (as errors) and warnings

  • (at the moment) the logger also prints the message in the standard output. (in the future, should not do that, grapa API should not print anything, only its GUI)

The GUI

  • (at the moment) Intercept exceptions and warnings, ignores GrapaError and GrapaWarning

  • (in the future, should print the messages of GrapaError and GrapaWarning)

@author: Romain Carron Copyright (c) 2026, Empa, Laboratory for Thin Films and Photovoltaics, Romain Carron

Functions

issue_warning(logger, msg, *args[, ...])

Logs a Warning in the logger, and issue a warnings.warn

Exceptions

FileNotCreatedError(*args[, report_in_gui])

Raise when a file could not be created

FileNotReadError(*args[, report_in_gui])

Raise when could not read a file

GrapaError(*args[, report_in_gui])

Base class for grapa Exception.

GrapaWarning

Base class for custom warnings.

IncorrectInputError(*args[, report_in_gui])

Raise when e.g. ehenever matplotlib is not happy with user input.