diff --git a/hive/server/common/helpers.py b/hive/server/common/helpers.py index bc02e32f18f75c4445f9e528243e4b8d5803c8d7..1dcc829990b20865bd78d321a56ebbdab769cc18 100644 --- a/hive/server/common/helpers.py +++ b/hive/server/common/helpers.py @@ -16,6 +16,9 @@ class ApiError(Exception): # pylint: disable=unnecessary-pass pass +# values -32768..-32000 are reserved +ACCESS_TO_DELETED_POST_ERROR_CODE = -31999 + def return_error_info(function): """Async API method decorator which catches and formats exceptions.""" @wraps(function) @@ -26,7 +29,7 @@ def return_error_info(function): except (RaiseException) as e: msg = e.diag.message_primary 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: raise AssertionError(msg) except (ApiError, AssertionError, TypeError, Exception) as e: diff --git a/tests/tests_api b/tests/tests_api index b174c02c821e6f2386cf31ee0f17969b1fa94289..ae53a82f46e6338a04e40b4966f8e7b0e64e6c86 160000 --- a/tests/tests_api +++ b/tests/tests_api @@ -1 +1 @@ -Subproject commit b174c02c821e6f2386cf31ee0f17969b1fa94289 +Subproject commit ae53a82f46e6338a04e40b4966f8e7b0e64e6c86