mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Return a dict structure to the API for ValidationErrors, for easier error identification/interface
This commit is contained in:
parent
64c6d7aa64
commit
442a1cf96d
1 changed files with 5 additions and 1 deletions
|
@ -48,7 +48,7 @@ class YunohostError(MoulinetteError):
|
|||
def content(self):
|
||||
|
||||
if not self.log_ref:
|
||||
return super(YunohostError, self).content()
|
||||
return super().content()
|
||||
else:
|
||||
return {"error": self.strerror, "log_ref": self.log_ref}
|
||||
|
||||
|
@ -56,3 +56,7 @@ class YunohostError(MoulinetteError):
|
|||
class YunohostValidationError(YunohostError):
|
||||
|
||||
http_code = 400
|
||||
|
||||
def content(self):
|
||||
|
||||
return {"error": self.strerror, "error_key": self.key}
|
||||
|
|
Loading…
Add table
Reference in a new issue