|
@@ -3,6 +3,7 @@
|
|
namespace App\Exceptions;
|
|
namespace App\Exceptions;
|
|
|
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|
|
|
+use Illuminate\Support\Facades\Http;
|
|
use Throwable;
|
|
use Throwable;
|
|
|
|
|
|
class Handler extends ExceptionHandler
|
|
class Handler extends ExceptionHandler
|
|
@@ -36,6 +37,7 @@ class Handler extends ExceptionHandler
|
|
*/
|
|
*/
|
|
public function report(Throwable $exception)
|
|
public function report(Throwable $exception)
|
|
{
|
|
{
|
|
|
|
+ $this->reportError($exception);
|
|
parent::report($exception);
|
|
parent::report($exception);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -52,4 +54,20 @@ class Handler extends ExceptionHandler
|
|
{
|
|
{
|
|
return parent::render($request, $exception);
|
|
return parent::render($request, $exception);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private function reportError(Throwable $e){
|
|
|
|
+ try {
|
|
|
|
+ $url = config('stag.backendUrl') . '/dev/reportPhpError';
|
|
|
|
+ $headers['secret'] = 'superman';
|
|
|
|
+ Http::asForm()
|
|
|
|
+ ->withHeaders($headers)
|
|
|
|
+ ->post($url, [
|
|
|
|
+ 'data'=>'FE2: '.$e->getMessage(),
|
|
|
|
+ 'secret' => 'superman'
|
|
|
|
+ ])
|
|
|
|
+ ->json();
|
|
|
|
+ }catch(\Exception $e){
|
|
|
|
+ //do nothing
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|