georchestra / georchestra-gateway

GNU General Public License v3.0
0 stars 5 forks source link

Display a better error page #93

Open fvanderbiest opened 7 months ago

fvanderbiest commented 7 months ago

Currently the gateway displays an unfriendly "Whitelabel Error Page" message when it crashes:

image

eg caused by:

Caused by: org.georchestra.ds.users.DuplicatedEmailException: there is a user with this email: test@provider.com
    at org.georchestra.ds.users.AccountDaoImpl.insert(AccountDaoImpl.java:148) ~[georchestra-ldap-account-management-23.1-SNAPSHOT.jar:na]
    at org.georchestra.gateway.accounts.admin.ldap.LdapAccountsManager.createInternal(LdapAccountsManager.java:94) ~[classes/:23.1-SNAPSHOT]
    at org.georchestra.gateway.accounts.admin.AbstractAccountsManager.createIfMissing(AbstractAccountsManager.java:64) ~[classes/:23.1-SNAPSHOT]
    at org.georchestra.gateway.accounts.admin.AbstractAccountsManager.lambda$getOrCreate$0(AbstractAccountsManager.java:40) ~[classes/:23.1-SNAPSHOT]
    at java.base/java.util.Optional.orElseGet(Unknown Source) ~[na:na]

What would be a better way of handling such errors ?

pmauduit commented 7 months ago

@edevosc2c already wrote a documentation to handle this: https://github.com/georchestra/georchestra-gateway/blob/main/docs/custom-error-pages.adoc

but I think it would be better to provide default customized pages (in the datadir ?)

fvanderbiest commented 7 months ago

Awesome ! Yes, having default pages in the datadir sounds like a neat option