class Error(Exception): (source)
Known subclasses: zim.applications.ApplicationError
, zim.fs.FileUnicodeError
, zim.fs.FileWriteError
, zim.fs.PathLookupError
, zim.gui.applications.NoApplicationFoundError
, zim.main.command.UsageError
, zim.main.NotebookLookupError
, zim.newfs.base.FileChangedError
, zim.newfs.base.FileExistsError
, zim.newfs.base.FileNotFoundError
, zim.newfs.base.FileNotWritableError
, zim.newfs.base.FileUnicodeError
, zim.newfs.base.FolderNotEmptyError
, zim.newfs.helpers.TrashCancelledError
, zim.newfs.helpers.TrashNotSupportedError
, zim.newfs.local.FileNameLenghtError
, zim.newfs.local.PathLenghtError
, zim.notebook.notebook.IndexNotUptodateError
, zim.notebook.notebook.PageError
, zim.notebook.notebook.PageExistsError
, zim.notebook.operations.NotebookOperationOngoing
, zim.notebook.page.PageReadOnlyError
, zim.parser.ParserError
, zim.plugins.inlinecalculator.ExpressionError
, zim.plugins.linesorter.NoSelectionError
, zim.plugins.versioncontrol.NoChangesError
, zim.www.WWWError
Base class for all errors in zim.
This class is intended for application and usage errors, these will be caught in the user interface and presented as error dialogs. In contrast and Exception that does not derive from this base class will result in a "You found a bug" dialog. Do not use this class e.g. to catch programming errors.
Subclasses should define two attributes. The first is 'msg', which is the short description of the error. Typically this gives the specific input / page / ... which caused the error. In there should be an attribute 'description' (either as class attribute or object attribute) with a verbose description. This description can be less specific but should explain the error in a user friendly way. The default behavior is to take 'msg' as the single argument for the constructor. So a minimal subclass only needs to define a class attribute 'description'.
For a typical error dialog in the Gtk interface the short string from 'msg' will be shown as the title in bold letters while the longer 'description' is shown below it in normal letters. As a guideline error classes that are used in the gui or that can be e.g. be raised on invalid input from the user should be translated.
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Instance Variable | description |
Undocumented |
Instance Variable | msg |
Undocumented |
zim.applications.ApplicationError
, zim.fs.FileUnicodeError
, zim.newfs.base.FileChangedError
, zim.newfs.base.FileExistsError
, zim.newfs.base.FileNotFoundError
, zim.newfs.base.FileNotWritableError
, zim.newfs.base.FileUnicodeError
, zim.newfs.base.FolderNotEmptyError
, zim.newfs.local.FileNameLenghtError
, zim.newfs.local.PathLenghtError
, zim.notebook.notebook.PageError
, zim.parser.ParserError
, zim.plugins.linesorter.NoSelectionError
, zim.plugins.versioncontrol.NoChangesError
, zim.www.WWWError
Undocumented
zim.applications.ApplicationError
, zim.fs.FileUnicodeError
, zim.main.NotebookLookupError
, zim.newfs.base.FileUnicodeError
, zim.newfs.local.FileNameLenghtError
, zim.newfs.local.PathLenghtError
, zim.notebook.notebook.PageNotAllowedError
, zim.notebook.notebook.PageNotAvailableError
, zim.parser.ParserError
, zim.plugins.inlinecalculator.ExpressionError
, zim.plugins.versioncontrol.NoChangesError
, zim.www.WebPageNotFoundError
, zim.www.WebPathNotValidError
Undocumented