src/Session.php
private static function checkForError(array $jsonResult)
    {
        if (isset($jsonResult[ 'success' ]) && true === (bool) $jsonResult[ 'success' ]) {
            return false;
        }

        if (isset($jsonResult[ 'error' ])) {
            $error = $jsonResult[ 'error' ];
            throw new WSException(
                $error[ 'message' ],
                $error[ 'code' ]
            );
        }

        // This should never happen
        throw new WSException('Unknown error');
    }
private static function checkForError(array $jsonResult)
    {
        if (isset($jsonResult[ 'success' ]) && true === (bool) $jsonResult[ 'success' ]) {
            return false;
        }

        if (isset($jsonResult[ 'error' ])) {
            $error = $jsonResult[ 'error' ];
            throw new WSException(
                $error[ 'message' ],
                $error[ 'code' ]
            );
        }

        // This should never happen
        throw new WSException('Unknown error');
    }
private static function checkForError ( array $ jsonResult ) { if ( isset ( $ jsonResult [ 'success' ] ) && true === ( bool ) $ jsonResult [ 'success' ] ) { return false ; } if ( isset ( $ jsonResult [ 'error' ] ) ) { $ error = $ jsonResult [ 'error' ] ; throw new WSException ( $ error [ 'message' ] , $ error [ 'code' ] ) ; } // This should never happen throw new WSException ( 'Unknown error' ) ; }
Check if server response contains an error, therefore the requested operation has failed
@access private
@static
@param  array $jsonResult Server response object to check for errors
@return boolean  True if response object contains an error
Check if server response contains an error therefore the requested operation has failed