hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hornn <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-102. Change error message when P...
Date Thu, 12 Nov 2015 17:44:13 GMT
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/100#discussion_r44688831
  
    --- Diff: src/backend/access/external/libchurl.c ---
    @@ -815,42 +815,49 @@ void check_response_code(churl_context* context)
     	}
     	else if (response_code != 200 && response_code != 100)
     	{
    -		if (!handle_special_error(response_code))
    -		{
    -			StringInfoData err;
    -			char    *http_error_msg;
    -			char    *addr;
    +		StringInfoData err;
    +		char    *http_error_msg;
    +		char    *addr;
     
    -			initStringInfo(&err);
    +		initStringInfo(&err);
     
    -			/* prepare response text if any */
    -			if (context->download_buffer->ptr)
    -			{
    -				context->download_buffer->ptr[context->download_buffer->top] = '\0';
    -				response_text = context->download_buffer->ptr + context->download_buffer->bot;
    -			}
    +		/* prepare response text if any */
    +		if (context->download_buffer->ptr)
    +		{
    +			context->download_buffer->ptr[context->download_buffer->top] = '\0';
    +			response_text = context->download_buffer->ptr + context->download_buffer->bot;
    +		}
     
    -			/* add remote http error code */
    -			appendStringInfo(&err, "remote component error (%ld)", response_code);
    +		/* add remote http error code */
    +		appendStringInfo(&err, "remote component error (%ld)", response_code);
     
    -			addr = get_dest_address(context->curl_handle);
    -			if (strlen(addr) != 0)
    -				appendStringInfo(&err, " from %s", addr);
    -			pfree(addr);
    +		addr = get_dest_address(context->curl_handle);
    +		if (strlen(addr) != 0)
    +		{
    +			appendStringInfo(&err, " from %s", addr);
    --- End diff --
    
    Good point. As far as I know the convention is to add curly brackets for each block, but
the code doesn't always follow that convention.
    In this case, I prefer to keep it that way to be make it clearer.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message