From 82bcc9cb05253fb975e05a0b1e8c346fef853ac2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 20 Aug 2021 12:00:02 +0200 Subject: [PATCH] publish validation error has more attributes --- openpype/pipeline/publish/publish_plugins.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/openpype/pipeline/publish/publish_plugins.py b/openpype/pipeline/publish/publish_plugins.py index 31bc715b62..bb1a87976b 100644 --- a/openpype/pipeline/publish/publish_plugins.py +++ b/openpype/pipeline/publish/publish_plugins.py @@ -1,5 +1,22 @@ class PublishValidationError(Exception): - pass + """Validation error happened during publishing. + + This exception should be used when validation publishing failed. + + Has additional UI specific attributes that may be handy for artist. + + Args: + message(str): Message of error. Short explanation an issue. + title(str): Title showed in UI. All instances are grouped under + single title. + description(str): Detailed description of an error. It is possible + to use Markdown syntax. + """ + def __init__(self, message, title=None, description=None): + self.message = message + self.title = title or "< Missing title >" + self.description = description or message + super(PublishValidationError, self).__init__(message) class KnownPublishError(Exception):