forked from OCA/rest-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rest_log: move exceptions to their own file
- Loading branch information
Showing
2 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com) | ||
# @author Simone Orsi <[email protected]> | ||
|
||
from odoo import exceptions as odoo_exceptions | ||
|
||
|
||
class RESTServiceDispatchException(Exception): | ||
|
||
rest_json_info = {} | ||
|
||
def __init__(self, message, log_entry_url): | ||
super().__init__(message) | ||
self.rest_json_info = {"log_entry_url": log_entry_url} | ||
|
||
|
||
class RESTServiceUserErrorException( | ||
RESTServiceDispatchException, odoo_exceptions.UserError | ||
): | ||
"""User error wrapped exception.""" | ||
|
||
|
||
class RESTServiceValidationErrorException( | ||
RESTServiceDispatchException, odoo_exceptions.ValidationError | ||
): | ||
"""Validation error wrapped exception.""" |