File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,27 @@ class MyCustomizedHandler extends AbstractHandler
272272}
273273``` 
274274
275+ -  Now just registry your customized handler on ` App\Exception\Handler `  file on attribute ` exceptionHandlers ` . E.g:
276+ 
277+ ``` php 
278+ namespace App\Exceptions;
279+ 
280+ use Exception;
281+ use GuzzleHttp\Exception\ClientException;
282+ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
283+ use SMartins\Exceptions\JsonHandler;
284+ 
285+ class Handler extends ExceptionHandler
286+ {
287+     use JsonHandler;
288+ 
289+     protected $exceptionHandlers = [
290+         // Set on key the exception and on value the handler.
291+         ClientException::class => GuzzleClientHandler::class,
292+     ];
293+ 
294+ ``` 
295+ 
275296## Response References:  
276297
277298-  http://jsonapi.org/format/#errors 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments