Remove throwing declarations

This commit is contained in:
Christoph Hagen 2023-01-31 22:17:15 +01:00
parent 5381b28386
commit 0a5139fd39
4 changed files with 6 additions and 6 deletions

View File

@ -27,8 +27,8 @@ final class SQLiteDatabase {
private let mail: MailConfig?
init(db: Database, mail: Configuration.EMail?) throws {
self.tables = try TableManagement(db: db)
init(db: Database, mail: Configuration.EMail?) {
self.tables = TableManagement(db: db)
guard let mail else {
self.mail = nil
return

View File

@ -17,7 +17,7 @@ final class TableManagement {
Load the tables from a file in the storage folder
- Throws: Errors when the file could not be read
*/
init(db: Database) throws {
init(db: Database) {
Table.query(on: db).with(\.$players).all().whenSuccess { loadedTables in
for table in loadedTables {
guard !table.players.isEmpty else {

View File

@ -55,7 +55,7 @@ public func configure(_ app: Application) throws {
app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory))
let db = app.databases.database(.sqlite, logger: .init(label: "Init"), on: app.databases.eventLoopGroup.next())!
server = try SQLiteDatabase(db: db, mail: configuration.mail)
server = SQLiteDatabase(db: db, mail: configuration.mail)
// Gracefully shut down by closing potentially open socket
DispatchQueue.global(qos: .utility).asyncAfter(deadline: .now() + .seconds(5)) {
@ -65,7 +65,7 @@ public func configure(_ app: Application) throws {
}
// register routes
try routes(app)
routes(app)
status.update(.nominal)
}

View File

@ -14,7 +14,7 @@ func encodeJSON<T>(_ response: T) throws -> String where T: Encodable {
return String(data: data, encoding: .utf8)!
}
func routes(_ app: Application) throws {
func routes(_ app: Application) {
registerPlayer(app)
requestPlayerPasswordReset(app)
resetPlayerPasswordWithEmailToken(app)