Skip to content

Commit

Permalink
Add stack trace in logs when exception
Browse files Browse the repository at this point in the history
  • Loading branch information
M0rgan01 committed Dec 20, 2024
1 parent a4d1511 commit b297c34
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion classes/Commands/AbstractBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

namespace PrestaShop\Module\AutoUpgrade\Commands;

use DateTime;
use Exception;
use PrestaShop\Module\AutoUpgrade\Backup\BackupFinder;
use PrestaShop\Module\AutoUpgrade\Backup\BackupManager;
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/CheckNewVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return ExitCode::SUCCESS;
} catch (Exception $e) {
$this->logger->error('An error occurred during the check new version process');
$this->logger->error("An error occurred during the check new version process:\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/CheckRequirementsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return $this->exitCode;
} catch (Exception $e) {
$this->logger->error('An error occurred during the check requirements process');
$this->logger->error("An error occurred during the check requirements process:\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/CreateBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return $exitCode;
} catch (Exception $e) {
$this->logger->error('An error occurred during the backup creation process');
$this->logger->error("An error occurred during the backup creation process::\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/DeleteBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return $exitCode;
} catch (Exception $e) {
$this->logger->error('An error occurred during the delete backup process');
$this->logger->error("An error occurred during the delete backup process:\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/ListBackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return ExitCode::SUCCESS;
} catch (Exception $e) {
$this->logger->error('An error occurred during the backup listing process');
$this->logger->error("An error occurred during the backup listing process:\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/RestoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return $exitCode;
} catch (Exception $e) {
$this->logger->error('An error occurred during the restoration process');
$this->logger->error("An error occurred during the restoration process:\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Commands/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int

return $this->chainCommand($output);
} catch (Exception $e) {
$this->logger->error('An error occurred during the update process');
$this->logger->error("An error occurred during the update process:\n" . $e->getTraceAsString());
throw $e;
}
}
Expand Down

0 comments on commit b297c34

Please sign in to comment.