mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
added exception
This commit is contained in:
parent
3a5be3b62f
commit
fb710111cb
21
app/Exceptions/ExceptionHandler.php
Normal file
21
app/Exceptions/ExceptionHandler.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Foundation\Exceptions\Handler;
|
||||||
|
|
||||||
|
|
||||||
|
class ExceptionHandler extends Handler
|
||||||
|
{
|
||||||
|
|
||||||
|
public function report(Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (app()->bound('sentry') && $this->shouldReport($e)) {
|
||||||
|
app('sentry')->captureException($e);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::report($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -79,7 +79,8 @@
|
|||||||
"visiosoft/integer-field_type": "~2.1.0",
|
"visiosoft/integer-field_type": "~2.1.0",
|
||||||
"visiosoft/list-field_type": "*",
|
"visiosoft/list-field_type": "*",
|
||||||
"guzzlehttp/guzzle": "~6.3.3",
|
"guzzlehttp/guzzle": "~6.3.3",
|
||||||
"composer/composer": "^1.6"
|
"composer/composer": "^1.6",
|
||||||
|
"sentry/sentry-laravel": "*"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"anomaly/streams-platform": "*"
|
"anomaly/streams-platform": "*"
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Sentry\Laravel\Facade;
|
||||||
|
use Sentry\Laravel\ServiceProvider;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -209,6 +212,8 @@ return [
|
|||||||
* Streams Service Provider
|
* Streams Service Provider
|
||||||
*/
|
*/
|
||||||
Anomaly\Streams\Platform\StreamsServiceProvider::class,
|
Anomaly\Streams\Platform\StreamsServiceProvider::class,
|
||||||
|
Sentry\Laravel\ServiceProvider::class,
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -257,6 +262,8 @@ return [
|
|||||||
'URL' => Illuminate\Support\Facades\URL::class,
|
'URL' => Illuminate\Support\Facades\URL::class,
|
||||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||||
'View' => Illuminate\Support\Facades\View::class,
|
'View' => Illuminate\Support\Facades\View::class,
|
||||||
|
'Sentry' => Sentry\Laravel\Facade::class,
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
36
config/sentry.php
Normal file
36
config/sentry.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
|
||||||
|
|
||||||
|
// capture release as git sha
|
||||||
|
// 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')),
|
||||||
|
|
||||||
|
// When left empty or `null` the Laravel environment will be used
|
||||||
|
'environment' => env('SENTRY_ENVIRONMENT'),
|
||||||
|
|
||||||
|
'breadcrumbs' => [
|
||||||
|
// Capture Laravel logs in breadcrumbs
|
||||||
|
'logs' => true,
|
||||||
|
|
||||||
|
// Capture SQL queries in breadcrumbs
|
||||||
|
'sql_queries' => true,
|
||||||
|
|
||||||
|
// Capture bindings on SQL queries logged in breadcrumbs
|
||||||
|
'sql_bindings' => true,
|
||||||
|
|
||||||
|
// Capture queue job information in breadcrumbs
|
||||||
|
'queue_info' => true,
|
||||||
|
|
||||||
|
// Capture command information in breadcrumbs
|
||||||
|
'command_info' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
// @see: https://docs.sentry.io/error-reporting/configuration/?platform=php#send-default-pii
|
||||||
|
'send_default_pii' => false,
|
||||||
|
|
||||||
|
'traces_sample_rate' => (float)(env('SENTRY_TRACES_SAMPLE_RATE', 1)),
|
||||||
|
|
||||||
|
'controllers_base_namespace' => env('SENTRY_CONTROLLERS_BASE_NAMESPACE', 'App\\Http\\Controllers'),
|
||||||
|
|
||||||
|
];
|
||||||
@ -1,7 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Exceptions\ExceptionHandler;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Listeners
|
| Listeners
|
||||||
@ -22,7 +24,9 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'bindings' => [],
|
'bindings' => [
|
||||||
|
'Anomaly\Streams\Platform\Exception\ExceptionHandler' => ExceptionHandler::class
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@ -118,7 +122,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'middleware_priority' => [],
|
'middleware_priority' => [],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| View Overrides
|
| View Overrides
|
||||||
@ -129,7 +133,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'overrides' => [],
|
'overrides' => [],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Control Panel Customization
|
| Control Panel Customization
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user