saloonphp / saloon

🤠 Build beautiful API integrations and SDKs with Saloon
https://docs.saloon.dev
MIT License
2.09k stars 107 forks source link

Feature | Fatal Exception Middleware #440

Closed craigpotter closed 3 months ago

craigpotter commented 3 months ago

This adds a new onFatalException middleware option that will be run went a fatal error occurs.

Example Usage:

Config::globalMiddleware()
    ->onFatalException(function (FatalRequestException $exception) {
        // do something 
    }, 'test', PipeOrder::FIRST); 

This could be used to notify someone or log errors.

Introduced usage of describe to tidy / group tests however this required bumping the minimum PestPHP version from 2.6 to 2.9