Skip to content

Commit

Permalink
feat(album): add error handling for album pattern parsing
Browse files Browse the repository at this point in the history
This commit adds error handling for parsing the album pattern in the deleteAlbum function. If the album pattern cannot be parsed, an error message is returned. This ensures that any errors in parsing the album pattern are properly handled.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
  • Loading branch information
rodneyosodo committed Feb 7, 2024
1 parent 072ee7b commit a31de3e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/album/album.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ func deleteAlbum(ctx context.Context, ic *immich.ImmichClient, log *logger.Log,
if len(args) > 0 {
re, err := regexp.Compile(args[0])
if err != nil {
if err != nil {
return fmt.Errorf("album pattern %q can't be parsed: %w", cmd.Arg(0), err)
}
return fmt.Errorf("album pattern %q can't be parsed: %w", cmd.Arg(0), err)
}
app.pattern = re
} else {
Expand Down

0 comments on commit a31de3e

Please sign in to comment.