1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 11:22:53 +02:00
- `getDB(string)` will now throw `BirchwoodException` with `ErrorType.DB_KEY_NOT_FOUND` if the key is not found

Exceptions

- Added member `DB_KEY_NOT_FOUND` to `ErrorType` enum
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-25 13:05:04 +02:00
parent c53fc034d2
commit fdcbcfeda4
2 changed files with 7 additions and 3 deletions

View File

@ -66,7 +66,12 @@ public enum ErrorType
* If invalid parameters are passed
* to any of the text formatting functions
*/
INVALID_FORMATTING
INVALID_FORMATTING,
/**
* If a key-lookup in the ConnInfo failed
*/
DB_KEY_NOT_FOUND
}
/**

View File

@ -136,8 +136,7 @@ public shared struct ConnectionInfo
}
else
{
// TODO: Should throw an exception
return "";
throw new BirchwoodException(ErrorType.DB_KEY_NOT_FOUND, "Could not find key '"~key~"'");
}
}