renderable(function (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $exception, $request) { return response()->json([ 'message' => 'not found'], 404); }); $this->renderable(function (InvalidOtpParameterException $exception, $request) { return response()->json([ 'message' => 'invalid OTP parameters', 'reason' => [$exception->getMessage()] ], 400); }); $this->renderable(function (InvalidQrCodeException $exception, $request) { return response()->json([ 'message' => 'not a valid QR code'], 400); }); $this->renderable(function (InvalidSecretException $exception, $request) { return response()->json([ 'message' => 'not a valid base32 encoded secret'], 400); }); $this->renderable(function (DbEncryptionException $exception, $request) { return response()->json([ 'message' => $exception->getMessage()], 400); }); } }