Skip to content

Commit

Permalink
Log traceback as well as exception in PredictionApiView.get_predictions
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger authored and epa095 committed May 28, 2019
1 parent e55e000 commit e757ec6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gordo_components/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import timeit
import dateutil.parser # type: ignore
import typing
import traceback
from functools import wraps
from datetime import datetime

Expand Down Expand Up @@ -152,7 +153,10 @@ def get_predictions(self, X: np.ndarray) -> np.ndarray:
try:
return current_app.model.transform(X) # type: ignore
except Exception as exc:
logger.error(f"Failed to predict or transform; error: {exc}")
tb = traceback.format_exc()
logger.error(
f"Failed to predict or transform; error: {exc} - \nTraceback: {tb}"
)
raise

@api.response(200, "Success", API_MODEL_OUTPUT_POST)
Expand Down

0 comments on commit e757ec6

Please sign in to comment.