fixed "missing test.db" error

This commit is contained in:
Nickiel12 2024-02-07 18:45:45 -08:00
parent 699391bbfb
commit 827d3052c9

View file

@ -18,10 +18,11 @@ func SetLogLevel(level zerolog.Level) {
func Init_testdb(DB_TYPE string, DB_CONNECTION_STRING string) {
cwd, err := os.Getwd()
cwd, err := os.Getwd();
if err != nil {
log.Fatal().Err(err).Msg("Could not get current working directory")
} else {
cwd = cwd + "/";
log.Trace().Msgf("Currect working directory is: %s", cwd)
}
@ -30,7 +31,7 @@ func Init_testdb(DB_TYPE string, DB_CONNECTION_STRING string) {
log.Debug().Msg("Found existing test.db file. Attempting to delete")
err = os.Remove(DB_CONNECTION_STRING)
if err != nil {
log.Fatal().Err(err).Msg("Failed to delete testing db")
log.Warn().Err(err).Msg("Failed to delete testing db. Continueing anyways")
} else {
log.Debug().Msg("Deleted test.db file successfully")
}