Throw an exception when trying to add a queue with an id already in use by another queue

This commit is contained in:
Tristan B. Velloza Kildaire 2021-09-09 18:00:59 +02:00
parent 26bdcf7d83
commit 0c43e80cf6
1 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import bmessage : bSendMessage = sendMessage;
import tristanable.queue : Queue; import tristanable.queue : Queue;
import tristanable.watcher; import tristanable.watcher;
import std.container.dlist; import std.container.dlist;
import tristanable.exceptions;
public final class Manager public final class Manager
{ {
@ -153,7 +154,9 @@ public final class Manager
} }
else else
{ {
/* TODO: Throw an error here */ /* Unlock queue before throwing an exception */
queuesLock.unlock();
throw new TristanableException(this, "Cannot add queue with id already in use");
} }
queuesLock.unlock(); queuesLock.unlock();