-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update.php #633
Comments
If you did not change anything, this comes from the data (RSS, etc.). Maybe there is something relevant in
|
I identified the problem, before to explain what happened I post the log entries after
Basically I recently changed the password on reddit. Obviously I forgot that the reddit spout requires username and password so the update process "crashed". I suggest to implement a user reporting whenever the login fails because on the source section I was not notified by that. Thank you for helping me. |
The reddit spout needs fixing for this. From a quick look at the code, it needs to check for login errors, and throw an exception if there is any so that the error can be reported to the user. Maybe something like the following can help. diff --git a/spouts/reddit/reddit2.php b/spouts/reddit/reddit2.php
index a2db306..251b32f 100644
--- a/spouts/reddit/reddit2.php
+++ b/spouts/reddit/reddit2.php
@@ -419,6 +419,9 @@ class reddit2 extends \spouts\spout {
$data = @curl_exec( $ch );
curl_close( $ch );
+ if( $data === false )
+ throw new exception('Could not get reddit content');
+
return $data;
}
@@ -480,11 +483,11 @@ class reddit2 extends \spouts\spout {
$response = curl_exec($ch);
$response = json_decode($response);
if (curl_errno($ch)) {
- print(curl_error($ch));
+ throw new \exception(curl_error($ch));
} else {
curl_close($ch);
if (count($response->json->errors) > 0){
- print($response);
+ throw new \exception($response);
} else {
$this->reddit_session = "reddit_session={$response->json->data->cookie}";
if (function_exists("apc_store")) { Unfortunately, I cannot test a possible fix as I do not use this spout. |
If you can assign this issue to me, I will try to fix it as soon as possible. |
Also, while you're at it, you can use |
The new |
update.php stopped working from this morning.
I cannot track down the bug, even because I have not changed a think on the VPS during the last three months, any of you had a similar issue ?
The text was updated successfully, but these errors were encountered: