Commit 9f3ca2e3 authored by catch's avatar catch

Issue #2998727 by th_tushar: Remove unnecessary try/catch from logger

parent e432eea9
......@@ -112,16 +112,9 @@ public function log($level, $message, array $context = []) {
$context['request_uri'] = $request->getUri();
$context['referer'] = $request->headers->get('Referer', '');
$context['ip'] = $request->getClientIP();
try {
if ($this->currentUser) {
$context['uid'] = $this->currentUser->id();
}
}
catch (\Exception $e) {
// An exception might be thrown if the database connection is not
// available or due to another unexpected reason. It is more important
// to log the error that we already have so any additional exceptions
// are ignored.
if ($this->currentUser) {
$context['uid'] = $this->currentUser->id();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment