error mail notification for vacations

This commit is contained in:
StudioTem committed 2023-12-08 10:29:20 +01:00
1 parent 644dd00ee4
commit f240da135e
3 files changed
+75 -1

No files matched your search

@@ -2,8 +2,10 @@
namespace App\Console\Commands;
use App\Mail\Error;
use App\Services\Intranet\IntranetService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
class SyncVacationsFromIntranet extends Command
{
@@ -30,7 +32,14 @@ class SyncVacationsFromIntranet extends Command
{
$intranetService = new IntranetService();
$intranetService->syncVacations();
try {
$intranetService->syncVacations();
} catch (\Exception $e) {
Mail::to('feher@studiotem.com')->send(new Error($e));
return Command::FAILURE;
}
return Command::SUCCESS;
}
}