diff --git a/frontend/src/gradio.jsx b/frontend/src/gradio.jsx index 62469bfe43..13067785f2 100644 --- a/frontend/src/gradio.jsx +++ b/frontend/src/gradio.jsx @@ -125,6 +125,9 @@ export class GradioInterface extends React.Component { this.props .fn(input_state, "predict", this.queueCallback) .then((output) => { + if (output["error"] != null) { + console.error("Error:", output["error"]); + } if (!this.pending_response) { return; } diff --git a/gradio/networking.py b/gradio/networking.py index 8fa0cf521a..89f383fdf5 100644 --- a/gradio/networking.py +++ b/gradio/networking.py @@ -182,9 +182,9 @@ def predict(): if app.interface.show_error: try: prediction, durations = app.interface.process(raw_input) - except BaseException: + except BaseException as error: traceback.print_exc() - return jsonify({"error": traceback.format_exc()}), 500 + return jsonify({"error": str(error)}), 500 else: prediction, durations = app.interface.process(raw_input) avg_durations = []