[ticket/11603] Throw RuntimeExceptions instead of using exit()

PHPBB3-11603
This commit is contained in:
Joas Schilling 2013-06-19 13:45:42 +02:00
parent 1516ae7e7e
commit 99e486dc82
2 changed files with 2 additions and 2 deletions

View file

@ -143,7 +143,7 @@ function api_url_request($url)
if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0) if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
{ {
exit('Reached github API Rate Limit. Please try again later' . "\n"); throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
} }
return $contents; return $contents;

View file

@ -187,7 +187,7 @@ function api_url_request($url)
if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0) if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
{ {
exit('Reached github API Rate Limit. Please try again later' . "\n"); throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
} }
return ($sub_request_result) ? array_merge($sub_request_result, $contents) : $contents; return ($sub_request_result) ? array_merge($sub_request_result, $contents) : $contents;