app = $app; } public function report(\Throwable $e) { $resource = fopen('php://stderr', 'w'); fwrite($resource, "An error was thrown! {$e->getMessage()}"); fwrite($resource, "{$e->getTraceAsString()}"); //Log the error. } public function reportError(int $error_nr, string $error, ?string $file, ?int $line) { $resource = fopen('php://stderr', 'w'); fwrite($resource, "An error occurred! {$error}"); fwrite($resource, "Occurred in {$file}, at line {$line}."); //Log the error. } }