Skip to content

Commit 1b6dbf9

Browse files
committed
update status code
1 parent f0c1616 commit 1b6dbf9

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION = (0, 7, 5)
1+
VERSION = (0, 7, 6)
22

33
__version__ = '.'.join(map(str, VERSION))

acedatacloud_scaffold/handlers/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ def write_error_sync(self, status_code, **kwargs):
3636
exception = kwargs["exc_info"][1]
3737
self.logger.exception(f'error {exception}')
3838
data = {}
39-
status = status_code or exception.status_code if hasattr(
40-
exception, 'status_code') else ERROR_STATUS_API_ERROR
39+
status = exception.status_code if hasattr(
40+
exception, 'status_code') else (status_code or
41+
ERROR_STATUS_API_ERROR)
4142
self.logger.debug(f'{self.trace_id} error status {status}')
4243
# construct error
4344
data = {

acedatacloud_scaffold/handlers/callback.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ def write_error_async(self, status_code, **kwargs):
5555
exception = kwargs["exc_info"][1]
5656
self.logger.exception(f'error {exception}')
5757
data = {}
58-
status = status_code or exception.status_code if hasattr(
59-
exception, 'status_code') else ERROR_STATUS_API_ERROR
58+
status = exception.status_code if hasattr(
59+
exception, 'status_code') else (status_code or
60+
ERROR_STATUS_API_ERROR)
6061
self.logger.debug(f'{self.trace_id} error status {status}')
6162
# construct error
6263
data = {

0 commit comments

Comments
 (0)