title: Displaying WPDB error in try catch not working?
body: <p>I am trying to create a Class that will be using a external api and wpdb class however i am having issues already in the try catch block please confirm the below is correct:</p>
  
  <pre><code>&lt;?php
  require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' );
  require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php' );
  
  class LoLApi
  {
    private $database;
  
    public function __construct()
    {
      try {
        $this-&gt;database = new wpdb('user', 'pass', 'table', '127.0.0.1');
        $this-&gt;database-&gt;show_errors();
      } catch (Exception $e) {
        return $e-&gt;getMessage();
      }
    }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>in the other page:</p>
  
  <pre><code>&lt;?php
    session_start();
    require 'includes/lolapi.class.php';
  
    $api = new LoLApi;
    exit();
  ?&gt;
  </code></pre>