From 32b78b0881ebcfb80659e2fd3d40d843d8b48eb2 Mon Sep 17 00:00:00 2001 From: Joshua Hong Date: Wed, 21 Jul 2021 14:50:52 -0400 Subject: [PATCH] Use default error messages --- roomserver/storage/postgres/storage.go | 2 +- roomserver/storage/sqlite3/storage.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/roomserver/storage/postgres/storage.go b/roomserver/storage/postgres/storage.go index 2c756bd86..4de926a14 100644 --- a/roomserver/storage/postgres/storage.go +++ b/roomserver/storage/postgres/storage.go @@ -61,7 +61,7 @@ func Open(dbProperties *config.DatabaseOptions, cache caching.RoomServerCaches) // Then prepare the statements. Now that the migrations have run, any columns referred // to in the database code should now exist. if err := d.prepare(db, cache); err != nil { - return nil, fmt.Errorf("Error preparing statements: %v", err) + return nil, err } return &d, nil diff --git a/roomserver/storage/sqlite3/storage.go b/roomserver/storage/sqlite3/storage.go index 5c32954c1..5f499dabc 100644 --- a/roomserver/storage/sqlite3/storage.go +++ b/roomserver/storage/sqlite3/storage.go @@ -18,7 +18,6 @@ package sqlite3 import ( "context" "database/sql" - "fmt" _ "github.com/mattn/go-sqlite3" @@ -72,7 +71,7 @@ func Open(dbProperties *config.DatabaseOptions, cache caching.RoomServerCaches) // Then prepare the statements. Now that the migrations have run, any columns referred // to in the database code should now exist. if err := d.prepare(db, cache); err != nil { - return nil, fmt.Errorf("Error preparing statements: %v", err) + return nil, err } return &d, nil