protected function checkAndThrow(array $contents)
    {
        if (isset($contents['errcode']) && 0 !== $contents['errcode']) {
            if (empty($contents['errmsg'])) {
                $contents['errmsg'] = 'Unknown';
            }
            throw new HttpException($contents['errmsg'], $contents['errcode']);
        }
    }
protected function checkAndThrow(array $contents)
    {
        if (isset($contents['errcode']) && 0 !== $contents['errcode']) {
            if (empty($contents['errmsg'])) {
                $contents['errmsg'] = 'Unknown';
            }
            throw new HttpException($contents['errmsg'], $contents['errcode']);
        }
    }
protected function checkAndThrow ( array $ contents ) { if ( isset ( $ contents [ 'errcode' ] ) && 0 !== $ contents [ 'errcode' ] ) { if ( empty ( $ contents [ 'errmsg' ] ) ) { $ contents [ 'errmsg' ] = 'Unknown' ; } throw new HttpException ( $ contents [ 'errmsg' ] , $ contents [ 'errcode' ] ) ; } }
Check the array data errors, and Throw exception when the contents contains error.
@param array $contents
@throws HttpException
Check the array data errors and Throw exception when the contents contains error .