PHP code example of yonna / throwable

1. Go to this page and download the library: Download yonna/throwable library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yonna / throwable example snippets



    

    use Yonna\Throwable\Exception;
    
    // 按原来捕捉抛出
    try{
        // ...
    } catch (\Throwable $e){
        Exception::origin($e);
    }
    
    Exception::throw('default exception');
    Exception::params('oh my params');
    Exception::database('oh my database');
    Exception::sdk('oh my sdk');
    Exception::debug('oh my debug');
    // more
    


    

    use Yonna\Throwable\Error;
    
    Error::throw('default');
    Error::notice('notice');
    Error::warning('warning');
    Error::deprecated('deprecated');