From 7c758c727a5ef32bf5936a98a76def28717bb1c7 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 13 Dec 2021 16:14:27 +0200 Subject: [PATCH] Provide meaningful error message when updating Quarkus in dev-mode Closes: #22105 --- .../deployment/dev/IsolatedDevModeMain.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java index 86b6770e72857..0792198e44625 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java @@ -334,12 +334,18 @@ public void close() { fsWatchUtil.shutdown(); try { stop(); + if (RuntimeUpdatesProcessor.INSTANCE == null) { + throw new IllegalStateException( + "Hot deployment of the application is not supported when updating the Quarkus version. The application needs to be stopped and dev mode started up again"); + } } finally { try { - try { - RuntimeUpdatesProcessor.INSTANCE.close(); - } catch (IOException e) { - log.error("Failed to close compiler", e); + if (RuntimeUpdatesProcessor.INSTANCE != null) { + try { + RuntimeUpdatesProcessor.INSTANCE.close(); + } catch (IOException e) { + log.error("Failed to close compiler", e); + } } for (HotReplacementSetup i : hotReplacementSetups) { i.close();