custom error page for SSO login failures

Hi,

I’ve xwiki running together with keycloak setup as (xwiki.properties) :
oidc.provider=https://KEYCLOAK.DOMAIN/realms/MYREALM
oidc.endpoint=https://KEYCLOAK.DOMAIN/realms/MYREALM/protocol/openid-connect
oidc.clientid=myxwikiclientid
oidc.secret=MYXWIKISECRET
oidc.user.nameFormater=${oidc.user.preferredUsername._clean}
oidc.groups.allowed=xwikiusersgrp

If a user successfully authenticates using keycloak, but is not a member of xwikiusergrp
i get http status 500 internal server error page, with many lines of stack trace explaining
the exact cause, specifically :
org.xwiki.contrib.oidc.provider.internal.OIDCException: The user is not allowed to authenticate because it’s not a member of the following groups: [xwikiusersgrp]

is there a way to customize this error page, or better yet to handle such condition not as internal server error but rather as a simple user login failure with a hint to contact admin to fix group membership ?

Thanks,
jb