com web/qa: More verbose logging: pulls/api.php
| From: | Johannes Schlüter | Date: | Tue, 07 May 2013 15:19:11 +0000 |
| Subject: | com web/qa: More verbose logging: pulls/api.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66859@lists.php.net to get a copy of this message | ||
Commit: 57841419f040984e51eef3909c920b57ed22ae2c
Author: Johannes Schlüter <johannes@schlueters.de> Tue, 7 May 2013 17:19:11 +0200
Parents: 2a9b5bdbeb459c9c00cc0f24ce059131d404f88e
Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=57841419f040984e51eef3909c920b57ed22ae2c
Log:
More verbose logging
Changed paths:
M pulls/api.php
Diff:
diff --git a/pulls/api.php b/pulls/api.php
index b5e5f01..0a47232 100644
--- a/pulls/api.php
+++ b/pulls/api.php
@@ -175,11 +175,19 @@ function ghupdate()
die(json_encode(array('success' => false, 'errors' =>
array("Invalid state"))));
}
- $pull_raw =
@file_get_contents(GITHUB_BASEURL.'repos/'.GITHUB_ORG.'/'.urlencode($_POST['repo']).'/pulls/'.$_POST['id']);
+ $url =
GITHUB_BASEURL.'repos/'.GITHUB_ORG.'/'.urlencode($_POST['repo']).'/pulls/'.$_POST['id'];
+ $pull_raw = @file_get_contents($url);
$pull = $pull_raw ? json_decode($pull_raw) : false;
if (!$pull) {
header('HTTP/1.0 400 Bad Request');
- die(json_encode(array('success' => false, 'errors' =>
array("Failed to get data from GitHub"))));
+ $_SESSION['debug'][] = array(
+ "message" => "Request to GitHub failed",
+ "url" => $url,
+ "http response" => $http_response_header,
+ "response" => $pull_raw,
+ "json error" => json_last_error()
+ );
+ die(json_encode(array('success' => false, 'errors' =>
array("Failed to get data from GitHub", "http" => $http_response_header,
"json" => json_last_error()))));
}
$comment = @get_magic_quotes_gpc() ? stripslashes($_POST['comment']) :
$_POST['comment'];