log trace to reported error

This commit is contained in:
Daniel Seifert 2022-11-04 00:05:52 +01:00
parent 8237917a06
commit d41c3da290
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
5 changed files with 7 additions and 0 deletions

View File

@ -73,6 +73,7 @@ class d3user_webauthn extends AdminDetailsController
} catch (Exception|ContainerExceptionInterface|NotFoundExceptionInterface|DoctrineDriverException $e) {
Registry::getUtilsView()->addErrorToDisplay($e);
Registry::getLogger()->error('webauthn creation request: '.$e->getMessage(), ['UserId' => $this->getEditObjectId()]);
Registry::getLogger()->debug($e->getTraceAsString());
Registry::getUtils()->redirect('index.php?cl=d3user_webauthn');
}
}
@ -93,6 +94,7 @@ class d3user_webauthn extends AdminDetailsController
}
} catch (WebauthnException|Exception|NotFoundExceptionInterface|ContainerExceptionInterface|DoctrineDriverException $e) {
Registry::getLogger()->error($e->getDetailedErrorMessage(), ['UserId' => $this->getEditObjectId()]);
Registry::getLogger()->debug($e->getTraceAsString());
Registry::getUtilsView()->addErrorToDisplay($e);
}
}

View File

@ -88,6 +88,7 @@ class d3webauthnadminlogin extends AdminController
Registry::getSession()->setVariable(WebauthnConf::GLOBAL_SWITCH, true);
Registry::getUtilsView()->addErrorToDisplay($e);
Registry::getLogger()->error('webauthn request options: '.$e->getDetailedErrorMessage(), ['UserId' => $userId]);
Registry::getLogger()->debug($e->getTraceAsString());
$this->getUtils()->redirect('index.php?cl=login');
}
}
@ -122,6 +123,7 @@ class d3webauthnadminlogin extends AdminController
} catch (WebauthnException $e) {
Registry::getUtilsView()->addErrorToDisplay($e);
Registry::getLogger()->error('Webauthn: '.$e->getDetailedErrorMessage(), ['UserId' => $userId]);
Registry::getLogger()->debug($e->getTraceAsString());
$user->logout();
$this->getUtils()->redirect('index.php?cl=login');
}

View File

@ -79,6 +79,7 @@ class d3_account_webauthn extends AccountController
$this->setPageType('requestnew');
} catch (WebauthnException $e) {
Registry::getLogger()->error('webauthn register: '.$e->getDetailedErrorMessage(), ['UserId: ' => $this->getUser()->getId()]);
Registry::getLogger()->debug($e->getTraceAsString());
Registry::getUtilsView()->addErrorToDisplay($e);
}
}

View File

@ -88,6 +88,7 @@ class d3webauthnlogin extends FrontendController
} catch (WebauthnException $e) {
Registry::getSession()->setVariable(WebauthnConf::GLOBAL_SWITCH, true);
Registry::getLogger()->error('webauthn request options: '.$e->getDetailedErrorMessage(), ['UserId' => $userId]);
Registry::getLogger()->debug($e->getTraceAsString());
Registry::getUtilsView()->addErrorToDisplay($e);
$this->getUtils()->redirect('index.php?cl=start');
}

View File

@ -202,6 +202,7 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
'Webauthn: '.$e->getDetailedErrorMessage(),
['UserId' => Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER)]
);
Registry::getLogger()->debug($e->getTraceAsString());
$user->logout();
}
}