From df4d479e54010d8ae8d5d2d5cf39720cc58bcee1 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 9 Sep 2021 18:01:14 +0200 Subject: [PATCH] Throw an exception when trying to remove a queue with an id not in use by any queue --- source/tristanable/manager.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/tristanable/manager.d b/source/tristanable/manager.d index a9f8adf..43c57ad 100644 --- a/source/tristanable/manager.d +++ b/source/tristanable/manager.d @@ -137,7 +137,9 @@ public final class Manager } else { - /* TODO: Throw an error here */ + /* Unlock queue before throwing an exception */ + queuesLock.unlock(); + throw new TristanableException(this, "Cannot remove a queue with an id not in use"); } queuesLock.unlock();