craft_cli.errors module

Error classes.

exception craft_cli.errors.CraftError(message, *, details=None, resolution=None, docs_url=None, logpath_report=True, reportable=True, retcode=1)[source]

Bases: Exception

Signal a program error with a lot of information to report.

Variables
  • message – the main message to the user, to be shown as first line (and probably only that, according to the different modes); note that in some cases the log location will be attached to this message.

  • details – the full error details received from a third party which originated the error situation

  • resolution – an extra line indicating to the user how the error may be fixed or avoided (to be shown together with ‘message’)

  • docs_url – an URL to point the user to documentation (to be shown together with ‘message’)

  • logpath_report – if the location of the log filepath should be presented in the screen as the final message

  • reportable – if an error report should be sent to some error-handling backend (like Sentry)

  • retcode – the code to return when the application finishes

Parameters
  • message (str) –

  • details (Optional[str]) –

  • resolution (Optional[str]) –

  • docs_url (Optional[str]) –

  • logpath_report (bool) –

  • reportable (bool) –

  • retcode (int) –