sepal_ui.scripts.decorator.catch_errors#

sepal_ui.scripts.decorator.catch_errors(alert=None, debug=None)[source]#

Decorator to execute try/except sentence and catch errors in the alert message.

If debug is True then the error is raised anyway.

Parameters:
  • alert (Alert | None) – Alert to display errors

  • debug (bool | None) – Whether to raise the error or not, default to false

Returns:

The return statement of the decorated method

Return type:

Any

New in version 3.0: moved from utils to a dedicated module

Deprecated since version 3.0: use sepal_ui.scripts.decorator.catch_errors instead