Skip to content
Permalink
Browse files

Fix incorrect error type on missing path.

  • Loading branch information...
dwsteele committed Jun 4, 2019
1 parent 4b91259 commit 0ab6f3bb87005d5a5d102156730b1e3099894189
@@ -299,7 +299,7 @@ storageInfoList(
result = this->interface.infoList(this->driver, path, callback, callbackData);

if (!result && param.errorOnMissing)
THROW_FMT(PathOpenError, STORAGE_ERROR_LIST_INFO_MISSING, strPtr(path));
THROW_FMT(PathMissingError, STORAGE_ERROR_LIST_INFO_MISSING, strPtr(path));
}
MEM_CONTEXT_TEMP_END();

@@ -339,7 +339,7 @@ storageList(const Storage *this, const String *pathExp, StorageListParam param)
{
// Error if requested
if (param.errorOnMissing)
THROW_FMT(PathOpenError, STORAGE_ERROR_LIST_MISSING, strPtr(path));
THROW_FMT(PathMissingError, STORAGE_ERROR_LIST_MISSING, strPtr(path));

// Build an empty list if the directory does not exist by default. This makes the logic in calling functions simpler
// when they don't care if the path is missing.
@@ -269,7 +269,7 @@ testRun(void)

TEST_ERROR_FMT(
queueNeed(strNew("000000010000000100000001"), false, queueSize, walSegmentSize, PG_VERSION_92),
PathOpenError, "unable to list files for missing path '%s/spool/archive/test1/in'", testPath());
PathMissingError, "unable to list files for missing path '%s/spool/archive/test1/in'", testPath());

// -------------------------------------------------------------------------------------------------------------------------
storagePathCreateNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
@@ -175,7 +175,7 @@ testRun(void)
parseOptionList[cfgOptConfigIncludePath].valueList = strLstAddZ(strLstNew(), BOGUS_STR);
TEST_ERROR(
cfgFileLoad(parseOptionList, backupCmdDefConfigValue,
backupCmdDefConfigInclPathValue, oldConfigDefault), PathOpenError,
backupCmdDefConfigInclPathValue, oldConfigDefault), PathMissingError,
"unable to list files for missing path '/BOGUS'");

// --config-include-path valid, --config invalid (does not exist)
@@ -255,7 +255,7 @@ testRun(void)
// -------------------------------------------------------------------------------------------------------------------------
TEST_ERROR_FMT(
storageInfoListP(storageTest, strNew(BOGUS_STR), (StorageInfoListCallback)1, NULL, .errorOnMissing = true),
PathOpenError, STORAGE_ERROR_LIST_INFO_MISSING, strPtr(strNewFmt("%s/BOGUS", testPath())));
PathMissingError, STORAGE_ERROR_LIST_INFO_MISSING, strPtr(strNewFmt("%s/BOGUS", testPath())));

TEST_RESULT_BOOL(
storageInfoListNP(storageTest, strNew(BOGUS_STR), (StorageInfoListCallback)1, NULL), false, "ignore missing dir");
@@ -294,7 +294,7 @@ testRun(void)

// -------------------------------------------------------------------------------------------------------------------------
TEST_ERROR_FMT(
storageListP(storageTest, strNew(BOGUS_STR), .errorOnMissing = true), PathOpenError, STORAGE_ERROR_LIST_MISSING,
storageListP(storageTest, strNew(BOGUS_STR), .errorOnMissing = true), PathMissingError, STORAGE_ERROR_LIST_MISSING,
strPtr(strNewFmt("%s/BOGUS", testPath())));

TEST_RESULT_PTR(storageListP(storageTest, strNew(BOGUS_STR), .nullOnMissing = true), NULL, "null for missing dir");

0 comments on commit 0ab6f3b

Please sign in to comment.
You can’t perform that action at this time.