File: exceptions.py

package info (click to toggle)
python-mkdocs 1.6.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,812 kB
  • sloc: python: 14,346; javascript: 10,535; perl: 143; sh: 57; makefile: 30; xml: 11
file content (41 lines) | stat: -rw-r--r-- 1,018 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from __future__ import annotations

from click import ClickException, echo


class MkDocsException(ClickException):
    """
    The base class which all MkDocs exceptions inherit from. This should
    not be raised directly. One of the subclasses should be raised instead.
    """


class Abort(MkDocsException, SystemExit):
    """Abort the build."""

    code = 1

    def show(self, *args, **kwargs) -> None:
        echo('\n' + self.format_message())


class ConfigurationError(MkDocsException):
    """
    This error is raised by configuration validation when a validation error
    is encountered. This error should be raised by any configuration options
    defined in a plugin's [config_scheme][].
    """


class BuildError(MkDocsException):
    """
    This error may be raised by MkDocs during the build process. Plugins should
    not raise this error.
    """


class PluginError(BuildError):
    """
    A subclass of [`mkdocs.exceptions.BuildError`][] which can be raised by plugin
    events.
    """