Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmackay committed Feb 6, 2018
2 parents a9016f2 + 989e855 commit 708b522
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
*/
if (getenv("RAVEN_URL"))
{
$client = (new Raven_Client(getenv("RAVEN_URL")))->install();
$client = (new Raven_Client(getenv("RAVEN_URL"), ['exclude' => ['HTTP_Exception_404']]))->install();

Kohana::$log->attach(new Log_Raven($client));
}
Expand Down
4 changes: 4 additions & 0 deletions application/classes/Log/Raven.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public function write(array $messages)
{
if (isset($message['additional']['exception']))
{
if ($message['additional']['exception'] instanceof HTTP_Exception) {
continue;
}

// Write each message into the log file
// Format: time --- level: body
$this->raven->captureException($message['additional']['exception']);
Expand Down
14 changes: 10 additions & 4 deletions application/classes/Ushahidi/Multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ protected function parseHost($host)
}
// If we still don't have a host
if (! $host) {
// .. parse the current URL
$url = Url::createFromServer($_SERVER);
// .. and grab the host
$host = $url->getHost()->toUnicode();
try {
// .. parse the current URL
$url = Url::createFromServer($_SERVER);
// .. and grab the host
$host = $url->getHost()->toUnicode();
} catch (\RuntimeException $e) {
// Something went wrong parsing the host
// Finally fallback to just $_SERVER vars
$host = $_SERVER['HTTP_HOST'];
}
}

// If $domain is set and we're at a subdomain of $domain..
Expand Down
4 changes: 2 additions & 2 deletions application/config/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'base_url' => '/',
'index_file' => FALSE,
'charset' => 'utf-8',
'errors' => false,
'errors' => true,
'profile' => FALSE,
'caching' => FALSE,
);
);
2 changes: 1 addition & 1 deletion plugins/data-provider-email/classes/DataProvider/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function fetch($limit = FALSE)
{
$errors = imap_errors();
$errors = is_array($errors) ? implode(', ', $errors) : "";
Kohana::$log->add(Log::ERROR, $e->getMessage() . ". Errors: :errors",
Kohana::$log->add(Log::INFO, $e->getMessage() . ". Errors: :errors",
[':errors' => $errors]);
}

Expand Down

0 comments on commit 708b522

Please sign in to comment.