1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-27 00:21:08 +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

@ -135,12 +135,9 @@ sub run
$strCommandPush . " ${strWalPath}/${strSourceFile1}",
{iExpectedExitStatus => ERROR_FILE_MISSING, oLogTest => $self->expect()});
# ??? C and Perl currently return different errors for info open failures -- this can be removed when Perl is gone
my $iExpectedError = !$bRemote ? ERROR_FILE_OPEN : ERROR_FILE_MISSING;
$oHostDbMaster->executeSimple(
$strCommandGet . " ${strSourceFile1} ${strWalPath}/RECOVERYXLOG",
{iExpectedExitStatus => $iExpectedError, oLogTest => $self->expect()});
{iExpectedExitStatus => ERROR_FILE_MISSING, oLogTest => $self->expect()});
#---------------------------------------------------------------------------------------------------------------------------
$oHostBackup->stanzaCreate(