Skip to content

Commit

Permalink
[daemon] Handle dedicated NoSuchSnapshot exception
Browse files Browse the repository at this point in the history
Replace the previous catch of `std::out_of_range` with the dedicated
exception for missing snapshots.
  • Loading branch information
ricab committed Jun 27, 2023
1 parent e494bd1 commit ab60589
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1778,9 +1778,9 @@ try // clang-format on
{
get_snapshot_info(vm.get_snapshot(snapshot));
}
catch (const std::out_of_range&)
catch (const NoSuchSnapshot& e)
{
add_fmt_to(errors, "snapshot \"{}\" does not exist", snapshot);
add_fmt_to(errors, e.what());
}
}
}
Expand Down

0 comments on commit ab60589

Please sign in to comment.