Happyr\LinkedIn\LinkedIn::getError PHP Method

getError() public method

public getError ( )
    public function getError()
    {
        if ($this->hasError()) {
            return new LoginError(GlobalVariableGetter::get('error'), GlobalVariableGetter::get('error_description'));
        }
    }

Usage Example

 public function testGetErrorWithMissingDescription()
 {
     $linkedIn = new LinkedIn(self::APP_ID, self::APP_SECRET);
     unset($_GET['error']);
     unset($_GET['error_description']);
     $_GET['error'] = 'foo';
     $this->assertEquals('foo', $linkedIn->getError()->getName());
     $this->assertNull($linkedIn->getError()->getDescription());
 }