]> granicus.if.org Git - icinga2/commitdiff
Fix package error message
authorJean Flach <jean-marcel.flach@icinga.com>
Mon, 18 Dec 2017 10:04:40 +0000 (11:04 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 19 Apr 2018 09:18:52 +0000 (11:18 +0200)
fixes #5879

refs #5881

lib/remote/configpackageshandler.cpp

index 48a624cf3e9d7bb2c96761f28046abb2e804c592..25ed7bafaf7fdaac6567f74b282d4daa5218f705 100644 (file)
@@ -98,7 +98,9 @@ void ConfigPackagesHandler::HandlePost(const ApiUser::Ptr& user, HttpRequest& re
                boost::mutex::scoped_lock lock(ConfigPackageUtility::GetStaticMutex());
                ConfigPackageUtility::CreatePackage(packageName);
        } catch (const std::exception& ex) {
-               HttpUtility::SendJsonError(response, 500, "Could not create package.", "");
+               HttpUtility::SendJsonError(response, 500, "Could not create package.",
+                       HttpUtility::GetLastParameter(params, "verboseErrors") ? DiagnosticInformation(ex) : "");
+               return;
        }
 
        result1->Set("code", 200);