33namespace Pterodactyl \Exceptions ;
44
55use Exception ;
6+ use Throwable ;
67use PDOException ;
78use Psr \Log \LoggerInterface ;
89use Swift_TransportException ;
@@ -72,12 +73,12 @@ class Handler extends ExceptionHandler
7273 * services such as AWS Cloudwatch or other monitoring you can replace the
7374 * contents of this function with a call to the parent reporter.
7475 *
75- * @param \Exception $exception
76+ * @param \Throwable $exception
7677 * @return mixed
7778 *
78- * @throws \Exception
79+ * @throws \Throwable
7980 */
80- public function report (Exception $ exception )
81+ public function report (Throwable $ exception )
8182 {
8283 if (! config ('app.exceptions.report_all ' , false ) && $ this ->shouldntReport ($ exception )) {
8384 return null ;
@@ -103,7 +104,7 @@ public function report(Exception $exception)
103104 return $ logger ->error ($ exception );
104105 }
105106
106- private function generateCleanedExceptionStack (Exception $ exception )
107+ private function generateCleanedExceptionStack (Throwable $ exception )
107108 {
108109 $ cleanedStack = '' ;
109110 foreach ($ exception ->getTrace () as $ index => $ item ) {
@@ -133,12 +134,12 @@ class_basename($exception),
133134 * Render an exception into an HTTP response.
134135 *
135136 * @param \Illuminate\Http\Request $request
136- * @param \Exception $exception
137+ * @param \Throwable $exception
137138 * @return \Symfony\Component\HttpFoundation\Response
138139 *
139- * @throws \Exception
140+ * @throws \Throwable
140141 */
141- public function render ($ request , Exception $ exception )
142+ public function render ($ request , Throwable $ exception )
142143 {
143144 $ connections = Container::getInstance ()->make (Connection::class);
144145
@@ -200,11 +201,11 @@ public function invalidJson($request, ValidationException $exception)
200201 /**
201202 * Return the exception as a JSONAPI representation for use on API requests.
202203 *
203- * @param \Exception $exception
204+ * @param \Throwable $exception
204205 * @param array $override
205206 * @return array
206207 */
207- public static function convertToArray (Exception $ exception , array $ override = []): array
208+ public static function convertToArray (Throwable $ exception , array $ override = []): array
208209 {
209210 $ error = [
210211 'code ' => class_basename ($ exception ),
@@ -259,10 +260,10 @@ protected function unauthenticated($request, AuthenticationException $exception)
259260 * Converts an exception into an array to render in the response. Overrides
260261 * Laravel's built-in converter to output as a JSONAPI spec compliant object.
261262 *
262- * @param \Exception $exception
263+ * @param \Throwable $exception
263264 * @return array
264265 */
265- protected function convertExceptionToArray (Exception $ exception )
266+ protected function convertExceptionToArray (Throwable $ exception )
266267 {
267268 return self ::convertToArray ($ exception );
268269 }
0 commit comments