Exceptions

exception markdownx.exceptions.MarkdownxImageUploadError(message, code=None, params=None)[source]

Custom MarkdownX exceptions.

static invalid_size(current, expected)[source]

The file is larger in size that the maximum allow in settings.py (or the default).

Parameters:
  • current (float, int) – Current size of the file.
  • expected (float, int) – Expected (maximum permitted) size of the file.
Returns:

Locale compatible version of the error with the following message:

  • Please keep file size under %(max)s. Current file size: %(current)s.’

Return type:

MarkdownxImageUploadError

static not_uploaded()[source]

No file is available to upload.

Returns:Locale compatible version of the error with the following message:
  • No files have been uploaded.
Return type:MarkdownxImageUploadError
static unsupported_format()[source]

The file is of a format not defined in settings.py or if default, in markdownx/settings.py.

Returns:Locale compatible version of the error with the following message:
  • File type is not supported.
Return type:MarkdownxImageUploadError