Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace 'omm' with 'hours' in errors #45

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,42 +134,42 @@ summary statistics for your tracked time.
db, err = setupDB(dbPathFull)
switch {
case errors.Is(err, errCouldntCreateDB):
fmt.Fprintf(os.Stderr, `Couldn't create omm's local database.
fmt.Fprintf(os.Stderr, `Couldn't create hours' local database.
%s

`, msgReportIssue)
case errors.Is(err, errCouldntInitializeDB):
fmt.Fprintf(os.Stderr, `Couldn't initialise omm's local database.
fmt.Fprintf(os.Stderr, `Couldn't initialise hours' local database.
%s

`, msgReportIssue)
// cleanup
cleanupErr := os.Remove(dbPathFull)
if cleanupErr != nil {
fmt.Fprintf(os.Stderr, `Failed to remove omm's database file as well (at %s). Remove it manually.
fmt.Fprintf(os.Stderr, `Failed to remove hours' database file as well (at %s). Remove it manually.
Clean up error: %s

`, dbPathFull, cleanupErr.Error())
}
case errors.Is(err, errCouldntOpenDB):
fmt.Fprintf(os.Stderr, `Couldn't open omm's local database.
fmt.Fprintf(os.Stderr, `Couldn't open hours' local database.
%s

`, msgReportIssue)
case errors.Is(err, pers.ErrCouldntFetchDBVersion):
fmt.Fprintf(os.Stderr, `Couldn't get omm's latest database version.
fmt.Fprintf(os.Stderr, `Couldn't get hours' latest database version.
%s

`, msgReportIssue)
case errors.Is(err, pers.ErrDBDowngraded):
fmt.Fprintf(os.Stderr, `Looks like you downgraded omm. You should either delete omm's database file (you
will lose data by doing that), or upgrade omm to the latest version.
fmt.Fprintf(os.Stderr, `Looks like you downgraded hours. You should either delete hours' database file (you
will lose data by doing that), or upgrade hours to the latest version.

`)
case errors.Is(err, pers.ErrDBMigrationFailed):
fmt.Fprintf(os.Stderr, `Something went wrong migrating omm's database.
fmt.Fprintf(os.Stderr, `Something went wrong migrating hours' database.

You can try running omm by passing it a custom database file path (using
You can try running hours by passing it a custom database file path (using
--db-path; this will create a new database) to see if that fixes things. If that
works, you can either delete the previous database, or keep using this new
database (both are not ideal).
Expand Down
Loading