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()

    $facebook = new Facebook(array(
            'appId'     =>  $appId,
            'secret'    => $app_secret,
            'default_graph_version' => 'v2.8', 

    $facveb_url = '';

    $loginUrl = $facebook->getLoginUrl(array(

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