diff options
author | Georg Pfuetzenreuter | 2022-05-11 18:21:21 +0200 |
---|---|---|
committer | Georg Pfuetzenreuter | 2022-05-11 18:21:21 +0200 |
commit | 2ea6f6174423d426205a5e047e2bd5e4b4cd2bd9 (patch) | |
tree | 1e417cd5b0cdf6638e25a94c1bb88397c7c8601e /src | |
parent | 812cf73cb76eeaed530a36c8e848354d7d9269dd (diff) | |
download | pubsh-web-2ea6f6174423d426205a5e047e2bd5e4b4cd2bd9.tar.gz pubsh-web-2ea6f6174423d426205a5e047e2bd5e4b4cd2bd9.tar.bz2 pubsh-web-2ea6f6174423d426205a5e047e2bd5e4b4cd2bd9.zip |
Shell removal task exception handling
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java b/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java index 26408df..135a424 100644 --- a/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java +++ b/src/main/java/net/libertacasa/pubsh/web/SchedulerBean.java @@ -29,9 +29,13 @@ public class SchedulerBean { return Tasks.oneTime("shell-removal") .execute((instance, ctx) -> { System.out.printf("Running container removal task - Instance: %s, ctx: %s\n", instance, ctx); - String username = instance.getId().split("&")[0]; - String containerid = instance.getId().split("&")[1]; - Docker.deleteShell(username, containerid); + try { + String username = instance.getId().split("&")[0]; + String containerid = instance.getId().split("&")[1]; + Docker.deleteShell(username, containerid); + } catch (com.github.dockerjava.api.exception.NotFoundException exception) { + System.out.printf("Container does not exist\n"); + } }); } |