Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change history
==============

1.3.0a5 (2018-11-20)

* traceback.print_exc() --> logging.error.

1.3.0a4 (2018-11-15)

* Add ErrHandler.handler_assertion_error.
Expand Down
2 changes: 1 addition & 1 deletion hobbit_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = [1, 3, 0, 'a4']
VERSION = [1, 3, 0, 'a5']
6 changes: 4 additions & 2 deletions hobbit_core/flask_hobbit/err_handler.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# -*- encoding: utf-8 -*-
import traceback
import logging

from sqlalchemy.orm import exc as orm_exc

from .response import Result, ServerErrorResult, gen_response, RESP_MSGS

logger = logging.getLogger(__name__)


class ErrHandler(object):
"""Base error handler that catch all exceptions. Be sure response is::
Expand Down Expand Up @@ -44,7 +46,7 @@ def handler_assertion_error(cls, e):

@classmethod
def handler_others(cls, e):
traceback.print_exc()
logging.error('UncheckedException:', exc_info=1)
return ServerErrorResult(code=500, detail=repr(e))

@classmethod
Expand Down