Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LOGS] Improve zip error logs #1078

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

M0rgan01
Copy link
Contributor

Questions Answers
Description? Improve zip error logs
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? -
Sponsor company -
How to test? -

@M0rgan01 M0rgan01 added this to the 7.0.0 milestone Dec 10, 2024
@M0rgan01
Copy link
Contributor Author

Proposal for improving error logs during zip actions

@M0rgan01 M0rgan01 force-pushed the Improve-zip-error-log branch from 5831b25 to 0fa2630 Compare December 10, 2024 15:22
$this->logger->error(
$this->translator->trans(
'Could not extract %file% from backup, the destination might not be writable.',
['%file%' => $zip->statIndex($i)['name']]
'Could not extract %file%: %error%',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'Could not extract %file%: %error%',
'Could not extract %file% from archive: %error%',

throw new ZipActionException('Unable to open zipFile ' . $zipFile);
$error = $zip->getStatusString();

$this->logger->error($this->translator->trans('Unable to open zipFile %s: %s', [$zipFile, $error]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->logger->error($this->translator->trans('Unable to open zipFile %s: %s', [$zipFile, $error]));
$this->logger->error($this->translator->trans('Unable to open archive %s: %s', [$zipFile, $error]));

$error = $zip->getStatusString();

$this->logger->error($this->translator->trans('Unable to open zipFile %s: %s', [$zipFile, $error]));
throw new ZipActionException('Unable to open zipFile ' . $zipFile . ': ' . $error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new ZipActionException('Unable to open zipFile ' . $zipFile . ': ' . $error);
throw new ZipActionException('Unable to open archive ' . $zipFile . ': ' . $error);

@M0rgan01 M0rgan01 force-pushed the Improve-zip-error-log branch from 0fa2630 to 5d3dd1c Compare December 10, 2024 17:11
Copy link

sonarcloud bot commented Dec 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

4 participants