1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Improve info error messages introduced in 74b72df9.

- Add detail to errors when info files are loaded with incorrect encryption settings.
- Throw FileMissingError rather than FileOpenError when both copies of the info file are missing.
- If one file is present (but errors) and the other is missing, then return the error for the file that was present.

Contributed by Cynthia Shang.
This commit is contained in:
Cynthia Shang
2018-12-10 16:32:41 -05:00
committed by David Steele
parent 80a3e21521
commit cbf514e191
8 changed files with 77 additions and 20 deletions

View File

@ -345,7 +345,7 @@ testRun(void)
HARNESS_FORK_CHILD()
{
TEST_ERROR_FMT(
cmdArchiveGet(), FileOpenError,
cmdArchiveGet(), FileMissingError,
"unable to load info file '%s/archive/test1/archive.info' or '%s/archive/test1/archive.info.copy':\n"
"FileMissingError: unable to open '%s/archive/test1/archive.info' for read: [2] No such file or directory\n"
"FileMissingError: unable to open '%s/archive/test1/archive.info.copy' for read: [2] No such file or"
@ -375,7 +375,7 @@ testRun(void)
HARNESS_FORK_CHILD()
{
TEST_ERROR_FMT(
cmdArchiveGet(), FileOpenError,
cmdArchiveGet(), FileMissingError,
"unable to load info file '%s/archive/test1/archive.info' or '%s/archive/test1/archive.info.copy':\n"
"FileMissingError: unable to open '%s/archive/test1/archive.info' for read: [2] No such file or directory\n"
"FileMissingError: unable to open '%s/archive/test1/archive.info.copy' for read: [2] No such file or"