forked from lix-project/lix
Add error message when FileIngestionMethod is out of bounds
bool coerces anything >0 to true, but in the future we may have other file ingestion methods. This shows a better error message when the “recursive” byte isn’t 1.
This commit is contained in:
parent
bfa1acd85c
commit
2299ef705c
|
@ -358,8 +358,10 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
||||||
std::string s, baseName;
|
std::string s, baseName;
|
||||||
FileIngestionMethod method;
|
FileIngestionMethod method;
|
||||||
{
|
{
|
||||||
bool fixed, recursive;
|
bool fixed; uint8_t recursive;
|
||||||
from >> baseName >> fixed /* obsolete */ >> recursive >> s;
|
from >> baseName >> fixed /* obsolete */ >> recursive >> s;
|
||||||
|
if (recursive > (uint8_t) FileIngestionMethod::Recursive)
|
||||||
|
throw Error("unsupported FileIngestionMethod with value of %i; you may need to upgrade nix-daemon", recursive);
|
||||||
method = FileIngestionMethod { recursive };
|
method = FileIngestionMethod { recursive };
|
||||||
/* Compatibility hack. */
|
/* Compatibility hack. */
|
||||||
if (!fixed) {
|
if (!fixed) {
|
||||||
|
|
Loading…
Reference in a new issue