- 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:
Tristan B. Velloza Kildaire 2023-03-25 16:29:22 +02:00
parent 00b683a558
commit 6961e0960f
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,6 @@
module renaissance.exceptions.errors;
public enum ErrorType
{
LISTENER_ALREADY_ADDED
}

View File

@ -0,0 +1,4 @@
module renaissance.exceptions;
public import renaissance.exceptions.errors : ErrorType;
public import renaissance.exceptions.types : RenaissanceException;

View File

@ -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;
}
}