From 0dca1f6a9f74696f7bc4a19b2b56a0994f8f3f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Wed, 22 May 2019 21:03:25 +0200 Subject: [PATCH] logovani vyjimek --- app/AdminModule/ConfigurationModule/forms/BankForm.php | 5 ++++- app/AdminModule/MailingModule/forms/SendForm.php | 3 +++ .../ProgramModule/components/ProgramBlocksGridControl.php | 5 ++++- app/WebModule/forms/ApplicationForm.php | 3 +++ app/WebModule/forms/PersonalDetailsForm.php | 3 +++ app/commands/ClearCacheCommand.php | 2 +- app/services/DiscountService.php | 4 ++-- app/services/SkautIsEventEducationService.php | 5 ++++- app/services/SkautIsEventGeneralService.php | 5 ++++- app/services/SkautIsEventService.php | 5 ++++- 10 files changed, 32 insertions(+), 8 deletions(-) diff --git a/app/AdminModule/ConfigurationModule/forms/BankForm.php b/app/AdminModule/ConfigurationModule/forms/BankForm.php index 03706cb40..6d8702fd0 100644 --- a/app/AdminModule/ConfigurationModule/forms/BankForm.php +++ b/app/AdminModule/ConfigurationModule/forms/BankForm.php @@ -16,6 +16,8 @@ use Nette; use Nette\Application\UI\Form; use Nextras\Forms\Controls\DatePicker; +use Tracy\Debugger; +use Tracy\ILogger; /** * Formulár pro nastavení párování plateb. @@ -90,7 +92,8 @@ public function processForm(Form $form, \stdClass $values) : void try { $this->bankService->downloadTransactions($from, $token); $this->settingsRepository->setValue(Settings::BANK_TOKEN, $token); - } catch (InternalErrorException $e) { + } catch (InternalErrorException $ex) { + Debugger::log($ex, ILogger::WARNING); $form['bankToken']->addError('admin.configuration.payment.bank.invalid_token'); } } diff --git a/app/AdminModule/MailingModule/forms/SendForm.php b/app/AdminModule/MailingModule/forms/SendForm.php index a8aa00133..7d0306e42 100644 --- a/app/AdminModule/MailingModule/forms/SendForm.php +++ b/app/AdminModule/MailingModule/forms/SendForm.php @@ -15,6 +15,8 @@ use Nette; use Nette\Application\UI\Form; use Nette\Mail\SendException; +use Tracy\Debugger; +use Tracy\ILogger; use Ublaboo\Mailing\Exception\MailingException; use Ublaboo\Mailing\Exception\MailingMailCreationException; @@ -141,6 +143,7 @@ public function processForm(Form $form, \stdClass $values) : void $this->mailService->sendMail($recipientsRoles, $recipientsSubevents, $recipientsUsers, $values['copy'], $values['subject'], $values['text']); $this->mailSuccess = true; } catch (SendException $ex) { + Debugger::log($ex, ILogger::WARNING); $this->mailSuccess = false; } } diff --git a/app/AdminModule/ProgramModule/components/ProgramBlocksGridControl.php b/app/AdminModule/ProgramModule/components/ProgramBlocksGridControl.php index 6a2aa5576..cdeb0e8fe 100644 --- a/app/AdminModule/ProgramModule/components/ProgramBlocksGridControl.php +++ b/app/AdminModule/ProgramModule/components/ProgramBlocksGridControl.php @@ -27,6 +27,8 @@ use Nette\Http\Session; use Nette\Http\SessionSection; use PhpOffice\PhpSpreadsheet\Exception; +use Tracy\Debugger; +use Tracy\ILogger; use Ublaboo\DataGrid\DataGrid; use Ublaboo\DataGrid\Exception\DataGridColumnStatusException; use Ublaboo\DataGrid\Exception\DataGridException; @@ -263,7 +265,8 @@ public function changeMandatory(int $id, string $mandatory) : void try { $this->programService->updateBlockMandatory($block, $mandatory); $p->flashMessage('admin.program.blocks_changed_mandatory', 'success'); - } catch (\Throwable $e) { + } catch (\Throwable $ex) { + Debugger::log($ex, ILogger::WARNING); $p->flashMessage('admin.program.blocks_change_mandatory_error', 'danger'); } } diff --git a/app/WebModule/forms/ApplicationForm.php b/app/WebModule/forms/ApplicationForm.php index 0e35fa71e..5f8060690 100644 --- a/app/WebModule/forms/ApplicationForm.php +++ b/app/WebModule/forms/ApplicationForm.php @@ -45,6 +45,8 @@ use function array_keys; use function count; use function in_array; +use Tracy\Debugger; +use Tracy\ILogger; /** * Formulář přihlášky. @@ -343,6 +345,7 @@ public function processForm(Form $form, \stdClass $values) : void $this->user->getState() ); } catch (WsdlException $ex) { + Debugger::log($ex, ILogger::WARNING); $this->onSkautIsError(); } diff --git a/app/WebModule/forms/PersonalDetailsForm.php b/app/WebModule/forms/PersonalDetailsForm.php index 7178cb56d..4aed509ad 100644 --- a/app/WebModule/forms/PersonalDetailsForm.php +++ b/app/WebModule/forms/PersonalDetailsForm.php @@ -15,6 +15,8 @@ use Nette\Application\UI\Form; use Skautis\Wsdl\WsdlException; use function array_key_exists; +use Tracy\Debugger; +use Tracy\ILogger; /** * Formulář pro úpravu osobních údajů. @@ -172,6 +174,7 @@ public function processForm(Form $form, \stdClass $values) : void $this->user->getState() ); } catch (WsdlException $ex) { + Debugger::log($ex, ILogger::WARNING); $this->onSkautIsError(); } } diff --git a/app/commands/ClearCacheCommand.php b/app/commands/ClearCacheCommand.php index d36438a98..10e5adce8 100644 --- a/app/commands/ClearCacheCommand.php +++ b/app/commands/ClearCacheCommand.php @@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output) : int $output->writeln('Cache cleared.'); return 0; - } catch (\Throwable $exc) { + } catch (\Throwable $ex) { $output->write('error'); return 1; } diff --git a/app/services/DiscountService.php b/app/services/DiscountService.php index 1a731687e..359c87f70 100644 --- a/app/services/DiscountService.php +++ b/app/services/DiscountService.php @@ -76,7 +76,7 @@ public function countDiscount(array $selectedSubeventsIds) : int try { $this->parseExpression($result); - } catch (InvalidArgumentException $exception) { + } catch (InvalidArgumentException $ex) { continue; } @@ -101,7 +101,7 @@ public function validateCondition(string $condition) : bool try { $this->parseExpression($result); - } catch (InvalidArgumentException $exception) { + } catch (InvalidArgumentException $ex) { return false; } diff --git a/app/services/SkautIsEventEducationService.php b/app/services/SkautIsEventEducationService.php index 11715213c..8d3527cba 100644 --- a/app/services/SkautIsEventEducationService.php +++ b/app/services/SkautIsEventEducationService.php @@ -11,6 +11,8 @@ use Skautis\Skautis; use Skautis\Wsdl\WsdlException; use function array_key_exists; +use Tracy\Debugger; +use Tracy\ILogger; /** * Služba pro správu vzdělávací skautIS akce. @@ -76,7 +78,8 @@ public function insertParticipants(int $eventId, Collection $users, bool $accept } } } - } catch (WsdlException $e) { + } catch (WsdlException $ex) { + Debugger::log($ex, ILogger::WARNING); return false; } diff --git a/app/services/SkautIsEventGeneralService.php b/app/services/SkautIsEventGeneralService.php index 90f895c5d..9ba622a2c 100644 --- a/app/services/SkautIsEventGeneralService.php +++ b/app/services/SkautIsEventGeneralService.php @@ -8,6 +8,8 @@ use Doctrine\Common\Collections\Collection; use Skautis\Wsdl\WsdlException; use function array_key_exists; +use Tracy\Debugger; +use Tracy\ILogger; /** * Služba pro správu obecné skautIS akce. @@ -44,7 +46,8 @@ public function insertParticipants(int $eventId, Collection $users, bool $accept $this->insertParticipant($eventId, $personId); } - } catch (WsdlException $e) { + } catch (WsdlException $ex) { + Debugger::log($ex, ILogger::WARNING); return false; } diff --git a/app/services/SkautIsEventService.php b/app/services/SkautIsEventService.php index bb3f4034b..b6e581ce1 100644 --- a/app/services/SkautIsEventService.php +++ b/app/services/SkautIsEventService.php @@ -8,6 +8,8 @@ use Doctrine\Common\Collections\Collection; use Skautis\Skautis; use Skautis\Wsdl\WsdlException; +use Tracy\Debugger; +use Tracy\ILogger; /** * Služba pro správu skautIS akce. @@ -67,7 +69,8 @@ public function getEventsOptions() : array foreach ($this->getDraftEvents() as $event) { $options[$event->ID] = $event->DisplayName; } - } catch (WsdlException $e) { + } catch (WsdlException $ex) { + Debugger::log($ex, ILogger::WARNING); } return $options; }