Currently, when a server error occurs and the debug flag is disabled, the error message “A server error occurred, to see the error enable the DEBUG flag.” comes up.
This error makes sense in a developer environment, but not for end users. If for example the database server is down, that’s the error end users will see.
As such, It’d be nice to have a simple setting for this in the server connect settings UI where this can be changed to a different static message, so in the event the database server is down for my apps, users could instead see a message such as “We are currently experiencing an issue, please check back shortly…” etc.
Somewhat, but unless I’m mistaken the 500 page doesn’t actually cover everything which produces this message.
I just setup a 500 page and disabled my database server, but I still get the error 500 “A server error occurred, to see this error enable the DEBUG flag.” when going to page rather than being redirected.
@Digo I understand the point, but what about this:
On error -> a page where says: "Sorry we have some issues, and we're looking it"
I have a flow on main layout (no auto load), on ERROR event global event, it execute an api call (other domain in case server fall) with path-location, timestamp, user identity, etc, the response is an UUID for tracking.
After that, redirect to a 500 page
That works for serverconnects indeed, but I again (will have to test) am not sure if this covers everything. In the event the database server is down, I don’t actually think it’ll make it to the serverconnect failure event.
That might be because I have actions in the globals section of Wappler, that runs first on any page load, regardless if the page in question has a serverconnect or not, and you can’t set an on failure for those.
I get the request might be a bit specific/niche, but I’m working on a project that’s deployed across 15+ servers with the ability to dynamically scale, and I’m trying to account for everything, including errors. Not all users may be tech savvy, so seeing a bit of an obscure error message might lead to some unexpected confusion if one of those servers has an issue.
Edit: Gave it a test, can confirm xhrerror doesn’t cover this. I’ll probably just have to implement a feature in my deployment script to change the message in the server.js directly.
When you have a 500 page created it will show that when an error occurred on a page. The only place you will see that message is in the serverconnect response when there was an error, that is not shown to users and you can handle them with the onError event to show your own message. The only users seeing it are the ones that look into devtools to inspect the network trafic.
In that case, maybe this is more an issue instead of a feature request as this was coming from loading the page itself and not a server connect url. Maybe I have some kind of issue with the 500 route. The layout page does have an error redirect like mentioned above