Skip to content

Commit

Permalink
Merge pull request #664 from jan-stanek/logovani
Browse files Browse the repository at this point in the history
logovani vyjimek
  • Loading branch information
jan-stanek authored May 22, 2019
2 parents 8556c92 + 0dca1f6 commit c955b2c
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 8 deletions.
5 changes: 4 additions & 1 deletion app/AdminModule/ConfigurationModule/forms/BankForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/AdminModule/MailingModule/forms/SendForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/WebModule/forms/ApplicationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}

Expand Down
3 changes: 3 additions & 0 deletions app/WebModule/forms/PersonalDetailsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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ů.
Expand Down Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/commands/ClearCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions app/services/DiscountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function countDiscount(array $selectedSubeventsIds) : int

try {
$this->parseExpression($result);
} catch (InvalidArgumentException $exception) {
} catch (InvalidArgumentException $ex) {
continue;
}

Expand All @@ -101,7 +101,7 @@ public function validateCondition(string $condition) : bool

try {
$this->parseExpression($result);
} catch (InvalidArgumentException $exception) {
} catch (InvalidArgumentException $ex) {
return false;
}

Expand Down
5 changes: 4 additions & 1 deletion app/services/SkautIsEventEducationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 4 additions & 1 deletion app/services/SkautIsEventGeneralService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 4 additions & 1 deletion app/services/SkautIsEventService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c955b2c

Please sign in to comment.