use report instead of logger
This commit is contained in:
parent
5ddfe315f4
commit
8dae25abc5
@ -6,8 +6,7 @@ use App\Events\Document\DocumentReminded;
|
|||||||
use App\Models\Common\Company;
|
use App\Models\Common\Company;
|
||||||
use App\Models\Document\Document;
|
use App\Models\Document\Document;
|
||||||
use App\Notifications\Purchase\Bill as Notification;
|
use App\Notifications\Purchase\Bill as Notification;
|
||||||
use App\Utilities\Overrider;
|
use App\Utilities\Date;
|
||||||
use Date;
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
class BillReminder extends Command
|
class BillReminder extends Command
|
||||||
@ -80,10 +79,10 @@ class BillReminder extends Command
|
|||||||
foreach ($bills as $bill) {
|
foreach ($bills as $bill) {
|
||||||
try {
|
try {
|
||||||
event(new DocumentReminded($bill, Notification::class));
|
event(new DocumentReminded($bill, Notification::class));
|
||||||
} catch (\Exception | \Throwable | \Swift_RfcComplianceException | \Illuminate\Database\QueryException $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
|
|
||||||
logger('Bill reminder:: ' . $e->getMessage());
|
report($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,7 @@ use App\Events\Document\DocumentReminded;
|
|||||||
use App\Models\Common\Company;
|
use App\Models\Common\Company;
|
||||||
use App\Models\Document\Document;
|
use App\Models\Document\Document;
|
||||||
use App\Notifications\Sale\Invoice as Notification;
|
use App\Notifications\Sale\Invoice as Notification;
|
||||||
use App\Utilities\Overrider;
|
use App\Utilities\Date;
|
||||||
use Date;
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
class InvoiceReminder extends Command
|
class InvoiceReminder extends Command
|
||||||
@ -80,10 +79,10 @@ class InvoiceReminder extends Command
|
|||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
try {
|
try {
|
||||||
event(new DocumentReminded($invoice, Notification::class));
|
event(new DocumentReminded($invoice, Notification::class));
|
||||||
} catch (\Exception | \Throwable | \Swift_RfcComplianceException | \Illuminate\Database\QueryException $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
|
|
||||||
logger('Invoice reminder:: ' . $e->getMessage());
|
report($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,10 +162,10 @@ class RecurringCheck extends Command
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->$function($model, $schedule_date);
|
return $this->$function($model, $schedule_date);
|
||||||
} catch (\Exception | \Throwable | \Swift_RfcComplianceException| \Swift_TransportException | \Illuminate\Database\QueryException $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
|
|
||||||
logger('Recurring check:: ' . $e->getMessage());
|
report($e);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ class Money
|
|||||||
|
|
||||||
$amount = money($money_format, $currency_code)->getAmount();
|
$amount = money($money_format, $currency_code)->getAmount();
|
||||||
} catch (InvalidArgumentException | OutOfBoundsException | UnexpectedValueException $e) {
|
} catch (InvalidArgumentException | OutOfBoundsException | UnexpectedValueException $e) {
|
||||||
logger($e->getMessage());
|
report($e);
|
||||||
|
|
||||||
$amount = 0;
|
$amount = 0;
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class InstallExtraModules
|
|||||||
|
|
||||||
$this->dispatch(new InstallModule($alias, $event->company_id, $event->locale));
|
$this->dispatch(new InstallModule($alias, $event->company_id, $event->locale));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
logger($e->getMessage());
|
report($e);
|
||||||
|
|
||||||
// Stop the propagation of event if the required module failed to install
|
// Stop the propagation of event if the required module failed to install
|
||||||
return false;
|
return false;
|
||||||
|
@ -58,7 +58,7 @@ class UpdateExtraModules
|
|||||||
if (true !== $result = Console::run($command)) {
|
if (true !== $result = Console::run($command)) {
|
||||||
$message = !empty($result) ? $result : trans('modules.errors.finish', ['module' => $alias]);
|
$message = !empty($result) ? $result : trans('modules.errors.finish', ['module' => $alias]);
|
||||||
|
|
||||||
logger($message);
|
report($message);
|
||||||
|
|
||||||
// Stop the propagation of event if the required module failed to update
|
// Stop the propagation of event if the required module failed to update
|
||||||
return false;
|
return false;
|
||||||
|
@ -42,7 +42,7 @@ class App extends Provider
|
|||||||
Model::handleLazyLoadingViolationUsing(function ($model, $relation) {
|
Model::handleLazyLoadingViolationUsing(function ($model, $relation) {
|
||||||
$class = get_class($model);
|
$class = get_class($model);
|
||||||
|
|
||||||
logger("Attempted to lazy load [{$relation}] on model [{$class}].");
|
report("Attempted to lazy load [{$relation}] on model [{$class}].");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,6 @@
|
|||||||
namespace App\Traits;
|
namespace App\Traits;
|
||||||
|
|
||||||
use Akaunting\Money\Money;
|
use Akaunting\Money\Money;
|
||||||
use InvalidArgumentException;
|
|
||||||
use OutOfBoundsException;
|
|
||||||
use UnexpectedValueException;
|
|
||||||
|
|
||||||
trait Currencies
|
trait Currencies
|
||||||
{
|
{
|
||||||
@ -20,8 +17,8 @@ trait Currencies
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$money = $money->$method((double) $rate);
|
$money = $money->$method((double) $rate);
|
||||||
} catch (InvalidArgumentException | OutOfBoundsException | UnexpectedValueException $e) {
|
} catch (\Throwable $e) {
|
||||||
logger($e->getMessage());
|
report($e);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user