mirror of
https://github.com/deavmi/tristanable.git
synced 2024-09-21 21:42:56 +02:00
Watcher
- Moved TODO below already completed code Exceptions - Renamed `Error` to `ErrorType` - Constructing a new `TristanableException` will now store the passed in `ErrorType` - Added `getError()` to `TristanableException` which returns the stored `ErrorType` - Added two new memebrs to enum `ErrorType`, namely `QUEUE_NOT_FOUND` and `QUEUE_ALREADY_EXISTS`
This commit is contained in:
parent
8942bd7f85
commit
454e7dd18e
@ -1,15 +1,26 @@
|
|||||||
module tristanable.exceptions;
|
module tristanable.exceptions;
|
||||||
|
|
||||||
public enum Error
|
public enum ErrorType
|
||||||
{
|
{
|
||||||
QueueExists
|
QueueExists,
|
||||||
|
QUEUE_NOT_FOUND,
|
||||||
|
QUEUE_ALREADY_EXISTS
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TristanableException : Exception
|
public class TristanableException : Exception
|
||||||
{
|
{
|
||||||
this(Error err)
|
private ErrorType err;
|
||||||
|
|
||||||
|
this(ErrorType err)
|
||||||
{
|
{
|
||||||
// TODO: Do this
|
// TODO: Do this
|
||||||
super("TODO: Do this");
|
super("TODO: Do this");
|
||||||
|
|
||||||
|
this.err = err;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ErrorType getError()
|
||||||
|
{
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -44,8 +44,6 @@ public class Watcher : Thread
|
|||||||
{
|
{
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
// TODO: Implement me
|
|
||||||
|
|
||||||
/* Do a bformat read-and-decode */
|
/* Do a bformat read-and-decode */
|
||||||
byte[] wireTristan;
|
byte[] wireTristan;
|
||||||
receiveMessage(socket, wireTristan);
|
receiveMessage(socket, wireTristan);
|
||||||
@ -53,7 +51,7 @@ public class Watcher : Thread
|
|||||||
/* Decode the received bytes into a tagged message */
|
/* Decode the received bytes into a tagged message */
|
||||||
TaggedMessage decodedMessage = TaggedMessage.decode(wireTristan);
|
TaggedMessage decodedMessage = TaggedMessage.decode(wireTristan);
|
||||||
|
|
||||||
|
// TODO: Implement me
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user