Add Sentry error captures

This commit is contained in:
Skylar Ittner 2025-04-02 17:28:53 -06:00
parent 7b8e41d50d
commit 766f132451
5 changed files with 6 additions and 3 deletions

View File

@ -41,6 +41,7 @@ try {
} }
} catch (Exception $ex) { } catch (Exception $ex) {
sendJsonResp($ex->getMessage(), "ERROR"); sendJsonResp($ex->getMessage(), "ERROR");
\Sentry\captureException($ex);
} }
exitWithJson($output); exitWithJson($output);

View File

@ -69,6 +69,7 @@ try {
"status" => "ERROR", "status" => "ERROR",
"msg" => $ex->getMessage() "msg" => $ex->getMessage()
]; ];
\Sentry\captureException($ex);
$memcache->set("logistics.tracking.$code.$carrier", json_encode($output), 60 * 10); $memcache->set("logistics.tracking.$code.$carrier", json_encode($output), 60 * 10);
exitWithJson(downgradeResponseVersion($output, $revision)); exitWithJson(downgradeResponseVersion($output, $revision));
} }

View File

@ -132,7 +132,7 @@ try {
} }
} }
} catch (Exception $ex) { } catch (Exception $ex) {
\Sentry\captureException($ex);
} }
// //
@ -199,7 +199,7 @@ try {
} }
} }
} catch (Exception $ex) { } catch (Exception $ex) {
\Sentry\captureException($ex);
} }
// Check local spammer database // Check local spammer database

View File

@ -60,4 +60,5 @@ try {
} catch (Exception $e) { } catch (Exception $e) {
Logger::log("network.whois error: " . $e->getMessage()); Logger::log("network.whois error: " . $e->getMessage());
sendJsonResp("An unknown error occurred.", "ERROR"); sendJsonResp("An unknown error occurred.", "ERROR");
\Sentry\captureException($ex);
} }

View File

@ -26,7 +26,7 @@ header("Access-Control-Allow-Origin: *");
// Composer // Composer
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
Sentry\init(['dsn' => 'https://1cb615831d87433c941e1bd7e7df3d0b@bugs.netsyms.net/3']); \Sentry\init(['dsn' => 'https://1cb615831d87433c941e1bd7e7df3d0b@bugs.netsyms.net/3']);
// Settings // Settings
require __DIR__ . '/env.php'; require __DIR__ . '/env.php';