Catch all

  try
  {

  }
  catch (\Throwable $e)
  {
    echo 'Throwable: ' . $e->getMessage();
  }

Catch specific

  try
  {
  }
  catch (\Exception $e)
  {
    echo 'Exception: ',  $e->getMessage(), "\n";
  }
  catch (\Error $e)
  {
    echo 'Error: ',  $e->getMessage(), "\n";
  }