How can I display the facebook login API errors in PHP SDK3

How can I display the Facebook login API errors or messages in the PHP SDK3? There are plenty of error functions inside Facebook_base.php file, how can I call them into PHP and be displayed when the user tries to login?

Below is what in users_controller.php

public function facebook_login()
{
    Configure::load('facebook');

    $appId=Configure::read('Facebook.appId');
    $app_secret=Configure::read('Facebook.secret');
    //SDK3
    $facebook = new Facebook(array(
            'appId'     =>  $appId,
            'secret'    => $app_secret,
            'default_graph_version' => 'v2.8', 
    ));

    $facveb_url = 'https://www.mywebsite.com/facebook_connect';

    $loginUrl = $facebook->getLoginUrl(array(

         'scope'        => 'email,public_profile', 
        'redirect_uri'  => $fb_url,
        'display'=>'popup',


    )); 
    $this->redirect($loginUrl);
}