Skip to content

Commit

Permalink
Add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl committed Aug 1, 2017
1 parent 82d20b9 commit 15cf8c0
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"require": {
"league/oauth2-client": "^2.2",
"joshcam/mysqli-database-class": "^2.7",
"curl/curl": "^1.6"
"curl/curl": "^1.6",
"sentry/sentry": "^1.7"
},
"license": "MIT",
"authors": [
Expand Down
67 changes: 66 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"client_secret" => "",
"redirect_uri" => "https://localhost/api/oauth_flow_finish"
],
"sentry" => [
"dsn" => "",
],
];

define("DATABASE_HOST", $config["db"]["host"]);
Expand Down
7 changes: 7 additions & 0 deletions include.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
require_once(__DIR__ . "/vendor/autoload.php");

require_once(__DIR__ . "/config.php");

// Set up sentry
if (!empty($config["sentry"]["dsn"])) {
$sentry = new Raven_Client($config["sentry"]["dsn"]);
$sentry->install();
}

require_once(__DIR__ . "/classes/DBPDO.php");

require_once(__DIR__ . "/classes/State.php");
Expand Down
4 changes: 3 additions & 1 deletion router.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

run_method($state);
} catch (Exception $e) {
// TODO: Log to sentry
if (isset($sentry)) {
$sentry->captureException($e);
}
error_message("server-side error", 500);
}

0 comments on commit 15cf8c0

Please sign in to comment.