Errors
- Added new module `errors` - Added new type `ErrorType` with enum member `LISTENER_ALREADY_ADDED` Exceptions (package) - Publically import `errors` (only `ErrorType`) and `RenaissanceException` from `types` Types - Added `RenaissanceException` type as the base exception class for the server code
This commit is contained in:
parent
00b683a558
commit
6961e0960f
|
@ -0,0 +1,6 @@
|
|||
module renaissance.exceptions.errors;
|
||||
|
||||
public enum ErrorType
|
||||
{
|
||||
LISTENER_ALREADY_ADDED
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
module renaissance.exceptions;
|
||||
|
||||
public import renaissance.exceptions.errors : ErrorType;
|
||||
public import renaissance.exceptions.types : RenaissanceException;
|
|
@ -0,0 +1,21 @@
|
|||
module renaissance.exceptions.types;
|
||||
|
||||
import renaissance.exceptions.errors : ErrorType;
|
||||
import std.conv : to;
|
||||
|
||||
public class RenaissanceException : Exception
|
||||
{
|
||||
private ErrorType error;
|
||||
|
||||
this(ErrorType error)
|
||||
{
|
||||
super(this.classinfo.name~": "~to!(string)(error));
|
||||
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public ErrorType getError()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue