format log messages in exception class
This commit is contained in:
parent
d41c3da290
commit
8aff5c8008
@ -72,7 +72,7 @@ class d3user_webauthn extends AdminDetailsController
|
|||||||
$this->setAuthnRegister();
|
$this->setAuthnRegister();
|
||||||
} catch (Exception|ContainerExceptionInterface|NotFoundExceptionInterface|DoctrineDriverException $e) {
|
} catch (Exception|ContainerExceptionInterface|NotFoundExceptionInterface|DoctrineDriverException $e) {
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
Registry::getLogger()->error('webauthn creation request: '.$e->getMessage(), ['UserId' => $this->getEditObjectId()]);
|
Registry::getLogger()->error($e->getMessage(), ['UserId' => $this->getEditObjectId()]);
|
||||||
Registry::getLogger()->debug($e->getTraceAsString());
|
Registry::getLogger()->debug($e->getTraceAsString());
|
||||||
Registry::getUtils()->redirect('index.php?cl=d3user_webauthn');
|
Registry::getUtils()->redirect('index.php?cl=d3user_webauthn');
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class d3webauthnadminlogin extends AdminController
|
|||||||
} catch (WebauthnException $e) {
|
} catch (WebauthnException $e) {
|
||||||
Registry::getSession()->setVariable(WebauthnConf::GLOBAL_SWITCH, true);
|
Registry::getSession()->setVariable(WebauthnConf::GLOBAL_SWITCH, true);
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
Registry::getLogger()->error('webauthn request options: '.$e->getDetailedErrorMessage(), ['UserId' => $userId]);
|
Registry::getLogger()->error($e->getDetailedErrorMessage(), ['UserId' => $userId]);
|
||||||
Registry::getLogger()->debug($e->getTraceAsString());
|
Registry::getLogger()->debug($e->getTraceAsString());
|
||||||
$this->getUtils()->redirect('index.php?cl=login');
|
$this->getUtils()->redirect('index.php?cl=login');
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ class d3webauthnadminlogin extends AdminController
|
|||||||
}
|
}
|
||||||
} catch (WebauthnException $e) {
|
} catch (WebauthnException $e) {
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
Registry::getLogger()->error('Webauthn: '.$e->getDetailedErrorMessage(), ['UserId' => $userId]);
|
Registry::getLogger()->error($e->getDetailedErrorMessage(), ['UserId' => $userId]);
|
||||||
Registry::getLogger()->debug($e->getTraceAsString());
|
Registry::getLogger()->debug($e->getTraceAsString());
|
||||||
$user->logout();
|
$user->logout();
|
||||||
$this->getUtils()->redirect('index.php?cl=login');
|
$this->getUtils()->redirect('index.php?cl=login');
|
||||||
|
@ -78,7 +78,7 @@ class d3_account_webauthn extends AccountController
|
|||||||
$this->setAuthnRegister();
|
$this->setAuthnRegister();
|
||||||
$this->setPageType('requestnew');
|
$this->setPageType('requestnew');
|
||||||
} catch (WebauthnException $e) {
|
} catch (WebauthnException $e) {
|
||||||
Registry::getLogger()->error('webauthn register: '.$e->getDetailedErrorMessage(), ['UserId: ' => $this->getUser()->getId()]);
|
Registry::getLogger()->error($e->getDetailedErrorMessage(), ['UserId: ' => $this->getUser()->getId()]);
|
||||||
Registry::getLogger()->debug($e->getTraceAsString());
|
Registry::getLogger()->debug($e->getTraceAsString());
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class d3webauthnlogin extends FrontendController
|
|||||||
$this->addTplParam('webauthn_publickey_login', $publicKeyCredentialRequestOptions);
|
$this->addTplParam('webauthn_publickey_login', $publicKeyCredentialRequestOptions);
|
||||||
} catch (WebauthnException $e) {
|
} catch (WebauthnException $e) {
|
||||||
Registry::getSession()->setVariable(WebauthnConf::GLOBAL_SWITCH, true);
|
Registry::getSession()->setVariable(WebauthnConf::GLOBAL_SWITCH, true);
|
||||||
Registry::getLogger()->error('webauthn request options: '.$e->getDetailedErrorMessage(), ['UserId' => $userId]);
|
Registry::getLogger()->error($e->getDetailedErrorMessage(), ['UserId' => $userId]);
|
||||||
Registry::getLogger()->debug($e->getTraceAsString());
|
Registry::getLogger()->debug($e->getTraceAsString());
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
$this->getUtils()->redirect('index.php?cl=start');
|
$this->getUtils()->redirect('index.php?cl=start');
|
||||||
|
@ -43,6 +43,6 @@ class WebauthnException extends StandardException
|
|||||||
*/
|
*/
|
||||||
public function setDetailedErrorMessage(string $detailedErrorMessage = null): void
|
public function setDetailedErrorMessage(string $detailedErrorMessage = null): void
|
||||||
{
|
{
|
||||||
$this->detailedErrorMessage = $detailedErrorMessage;
|
$this->detailedErrorMessage = 'Webauthn: '.$detailedErrorMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -199,7 +199,7 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
|
|||||||
} catch (WebauthnException $e) {
|
} catch (WebauthnException $e) {
|
||||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||||
Registry::getLogger()->error(
|
Registry::getLogger()->error(
|
||||||
'Webauthn: '.$e->getDetailedErrorMessage(),
|
$e->getDetailedErrorMessage(),
|
||||||
['UserId' => Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER)]
|
['UserId' => Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER)]
|
||||||
);
|
);
|
||||||
Registry::getLogger()->debug($e->getTraceAsString());
|
Registry::getLogger()->debug($e->getTraceAsString());
|
||||||
|
Loading…
Reference in New Issue
Block a user