Better handling of some alerting errors (#13446)

* Better handling of some alerting errors

* Better error output

* Consolidate simple template parsing

* Fixes reported by phpstan (one was a bug, yay!)

* add back forgotten trim

* don't remove the template if there is no match

* Match previous behavior, which was inconsistent.

* use anonymous class for tests instead

* Oopsie, Stringable is PHP8+

* fix style
This commit is contained in:
Tony Murray
2021-10-29 22:12:20 -05:00
committed by GitHub
parent 99d2462b80
commit 2c77edf4d2
12 changed files with 187 additions and 124 deletions

View File

@@ -44,7 +44,8 @@ class AlertTransportController extends Controller
return response()->json(['status' => 'ok']);
}
} catch (\Exception $e) {
$result = $e->getMessage();
\Log::error($e);
$result = basename($e->getFile(), '.php') . ':' . $e->getLine() . ' ' . $e->getMessage();
}
return response()->json([