title: Handling Multiple Exception Types For One Try Block
body: <p>Is there a cleaner way to handle multiple exception types for a single try block? As you will see below we have specific code that is to be executed for the different catch statements. </p>
  
  <p>This function is one of many which use the repeated try catch logic. Is it possible to eliminate this repeated catch code somehow?</p>
  
  <pre><code>public function add_payment_method(Request $request){
  
      try{
  
          // Try to do some stuff
  
      } catch (\Stripe\Error\RateLimit $e) {
  
          /*
              CODE FOR THIS SPECIFIC EXCEPTION
          */
  
      } catch (\Stripe\Error\InvalidRequest $e) {
  
  
           /*
              CODE FOR THIS SPECIFIC EXCEPTION
          */
  
  
      } catch (\Stripe\Error\Authentication $e) {
  
  
           /*
              CODE FOR THIS SPECIFIC EXCEPTION
          */
  
  
      } catch (\Stripe\Error\Base $e) {
  
  
           /*
              CODE FOR THIS SPECIFIC EXCEPTION
          */
  
  
      } catch (\Stripe\Error\ApiConnection $e) {
  
  
           /*
              CODE FOR THIS SPECIFIC EXCEPTION
          */
  
  
      } catch (\Exception $e) {
  
  
           /*
              CODE FOR GENERIC EXCEPTION
          */
  
  
      }
  
  }
  </code></pre>