From dc32f955b7b78022c4efce35a071253c95710387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 10 Dec 2019 16:16:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20forwarding=20of=20HTTPExce?= =?UTF-8?q?ptions=20on=20SimpleApiPlugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of #3375 --- src/octoprint/server/api/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/octoprint/server/api/__init__.py b/src/octoprint/server/api/__init__.py index ca0f01887..e2d55759e 100644 --- a/src/octoprint/server/api/__init__.py +++ b/src/octoprint/server/api/__init__.py @@ -10,6 +10,7 @@ import logging from flask import Blueprint, request, jsonify, abort, current_app, session, make_response, g from flask_login import login_user, logout_user, current_user +from werkzeug.exceptions import HTTPException from octoprint.vendor.flask_principal import Identity, identity_changed, AnonymousIdentity import octoprint.access.users @@ -72,6 +73,8 @@ def pluginData(name): if response is not None: return response return NO_CONTENT + except HTTPException: + raise except Exception: logging.getLogger(__name__).exception("Error calling SimpleApiPlugin {}".format(name), extra=dict(plugin=name)) @@ -107,6 +110,8 @@ def pluginCommand(name): if response is not None: return response return NO_CONTENT + except HTTPException: + raise except Exception: logging.getLogger(__name__).exception("Error while executing SimpleApiPlugin {}".format(name), extra=dict(plugin=name))