Skip to content
Snippets Groups Projects
Commit bc9bacdb authored by Andrzej Lisak's avatar Andrzej Lisak
Browse files

[ABW]: changed error code for access to deleted post (previously used code was...

[ABW]: changed error code for access to deleted post (previously used code was mistakenly taken from reserved range)
parent 6ccfb698
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!294changed error code for access to deleted post
...@@ -16,6 +16,9 @@ class ApiError(Exception): ...@@ -16,6 +16,9 @@ class ApiError(Exception):
# pylint: disable=unnecessary-pass # pylint: disable=unnecessary-pass
pass pass
# values -32768..-32000 are reserved
ACCESS_TO_DELETED_POST_ERROR_CODE = -31999
def return_error_info(function): def return_error_info(function):
"""Async API method decorator which catches and formats exceptions.""" """Async API method decorator which catches and formats exceptions."""
@wraps(function) @wraps(function)
...@@ -26,7 +29,7 @@ def return_error_info(function): ...@@ -26,7 +29,7 @@ def return_error_info(function):
except (RaiseException) as e: except (RaiseException) as e:
msg = e.diag.message_primary msg = e.diag.message_primary
if 'was deleted' in msg: if 'was deleted' in msg:
raise RPCApiError('Invalid parameters',-32199,msg) # deleted post raise RPCApiError('Invalid parameters', ACCESS_TO_DELETED_POST_ERROR_CODE, msg)
else: else:
raise AssertionError(msg) raise AssertionError(msg)
except (ApiError, AssertionError, TypeError, Exception) as e: except (ApiError, AssertionError, TypeError, Exception) as e:
......
Subproject commit b174c02c821e6f2386cf31ee0f17969b1fa94289 Subproject commit ae53a82f46e6338a04e40b4966f8e7b0e64e6c86
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment