Skip to content

Commit

Permalink
Catch curl errors in github scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Jan 9, 2015
1 parent d598673 commit 1972608
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion bin/postComment.php
Expand Up @@ -15,5 +15,11 @@
json_encode( array( "body" => file_get_contents( $argv[3] ) ) )
);

curl_exec( $ch );
if ( curl_exec( $ch ) === false )
{
echo "\n\n# postComment.php curl error:\n" . curl_error( $ch ) . "\n\n";
curl_close( $ch );
exit( 1 );
}

curl_close( $ch );
8 changes: 7 additions & 1 deletion bin/setCommitStatus.php
Expand Up @@ -29,5 +29,11 @@
)
);

curl_exec( $ch );
if ( curl_exec( $ch ) === false )
{
echo "\n\n# setCommit.php curl error:\n" . curl_error( $ch ) . "\n\n";
curl_close( $ch );
exit( 1 );
}

curl_close( $ch );

0 comments on commit 1972608

Please sign in to comment.