mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 10:06:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			606 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			606 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Services\Exceptions;
 | 
						|
 | 
						|
use Exception;
 | 
						|
use Filament\Notifications\Notification;
 | 
						|
 | 
						|
class FilamentExceptionHandler
 | 
						|
{
 | 
						|
    public function handle(Exception $exception, callable $stopPropagation): void
 | 
						|
    {
 | 
						|
        Notification::make()
 | 
						|
            ->title($exception->title ?? null)
 | 
						|
            ->body($exception->body ?? $exception->getMessage())
 | 
						|
            ->color($exception->color ?? 'danger')
 | 
						|
            ->icon($exception->icon ?? 'tabler-x')
 | 
						|
            ->danger()
 | 
						|
            ->send();
 | 
						|
 | 
						|
        if ($this->stopPropagation ?? true) {
 | 
						|
            $stopPropagation();
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |