diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index c5e48375..ab59a4ef 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -5,7 +5,6 @@ namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; -use Sentry\Laravel\Integration; use Illuminate\Http\Response; use Illuminate\Validation\UnauthorizedException; use Illuminate\Validation\ValidationException; @@ -13,13 +12,6 @@ class Handler extends ExceptionHandler { - public function register() - { - $this->reportable(function (Throwable $e) { - Integration::captureUnhandledException($e); - }); - } - /** * Report or log an exception. * @@ -67,7 +59,7 @@ public function render($request, Throwable $throwable) } if ($throwable instanceof TikTokException) { - return response()->json( ['error' => $throwable->getMessage()]); + return response()->json(['error' => $throwable->getMessage()]); } return parent::render($request, $throwable); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 36e30362..bbc4e800 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -8,6 +8,7 @@ use App\Http\Requests\UserStoreRequest; use App\Http\Requests\UserUpdateRequest; use App\Jobs\TriggerEmailVerificationProcess; +use App\Mail\OtpWasGenerated; use App\Models\EmailVerification; use App\Models\Following; use App\Models\User; @@ -290,9 +291,9 @@ public function generateOtp(Request $request, Otp $otp) ); try { - Mail::to($identifier)->send(new \App\Mail\OtpWasGenerated($token->token)); + Mail::to($identifier)->send(new OtpWasGenerated($token->token)); } catch (\Exception $exception) { - Log::debug('Error sending email', ['e' => $exception]); + Log::debug('Error sending otp email', ['e' => $exception]); return $this->errorResponse(['message' => 'There was an error processing this request. Please try again.']); } } diff --git a/app/Listeners/GetTikTokUserVideos.php b/app/Listeners/GetTikTokUserVideos.php index cf4c0a7d..f991ae0c 100644 --- a/app/Listeners/GetTikTokUserVideos.php +++ b/app/Listeners/GetTikTokUserVideos.php @@ -2,10 +2,10 @@ namespace App\Listeners; -use App\Exceptions\TikTokException; use GuzzleHttp\Client; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; class GetTikTokUserVideos { @@ -61,8 +61,7 @@ public function handle(object $event): void } } catch(\Exception $exception) { - dd($exception->getMessage()); -// throw new TikTokException($exception->getMessage(), $context); + Log::debug('Error listing TikTok videos', ['e' => $exception]); } } } diff --git a/config/logging.php b/config/logging.php index 31d4bae3..8518f2a5 100755 --- a/config/logging.php +++ b/config/logging.php @@ -19,7 +19,7 @@ | */ - 'default' => env('LOG_CHANNEL', 'stack'), + 'default' => env('LOG_CHANNEL', 'sentry'), /* |-------------------------------------------------------------------------- @@ -101,6 +101,11 @@ 'emergency' => [ 'path' => storage_path('logs/laravel.log'), ], + + 'sentry' => [ + 'driver' => 'sentry', + 'channels' => ['single', 'sentry'], + ], ], ]; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..a1493f2f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "api", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}