Skip to content

Edit failure strategy when there are no backups #60

Description

Right now it errors in this function call:

var mostRecentFullBackup = MostRecentFullBackup(recentBackups);

on this Linq expression:

return backups.Where(b => b.BackupType == BackupFileTools.BackupType.Full).OrderByDescending(d => d.CheckpointLsn)
.First();

like this:

System.InvalidOperationException
Sequence contains no elements

We could fail this more gracefully, by adding a few checks and chaining it with a more informative Exception?
OR we can recover by just setting _orderedBackups = new List<BackupMetadata>()?

I'm not sure which would be the preferred choice.
If I had to choose, I would go for the more informative exception - then the users can handle this error any which way they want.

What do you guys think?
Alex Irion (@alexirion10) Ryan Clare (@Kaneraz)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions