Preface: I won't get into the extreme details, but we've had a lot of issues with our mobile application, and we wanted to switch it to be a reactive application instead. We quickly found out that there is no easy conversion, so we created a reactive application and started copying things over, page-by-page.
After getting that working properly, we then renamed the original mobile application to some temp name and renamed the new, reactive application to have the original name.
The problem is that anyone who has ever gone to the old, mobile application in their browser has something in their cache that looks for certain things when they go to that URL. Now that it is a reactive application, whatever things it is looking for are no longer there, and it immediately redirects to a static "_error.html" page, which I have no control over.
If I clear that cache (which I've figured out how to do in JavaScript), then it works just fine. The issue is that I have no control over that static error page, so I can't even attempt to run any JavaScript to clear it and redirect back.
Actual Question: I'm wanting to know if there's any way to either create a custom "_error.html" page or redirect to some other error page (even if it has to be in another module) when an error occurs that would redirect to the static "_error.html" page.
I've tried going in and changing the contents of that page on the server, but it gets overwritten every time you publish, not to mention you have to change the file permissions to do anything in it.
What controls redirecting to this page? Is there a setting somewhere that can be tweaked?
Hi @Eric Patton,
you can create your own custom HTTP 404 (Not Found) error page using this plugin where you will have more control to run your JavaScript.
https://www.outsystems.com/forge/component-overview/15534/custom-404-plugin
Kind regards,
Sanjay Kushwah
Thank you for your reply, Sanjay. This looks promising, but there's a problem. The author of this component lists out a step-by-step guide on how to implement this, but the crucial code snippets he links to don't seem to exist anymore. I checked their GitHub repositories and can't find them anywhere.
https://github.com/dawud-outsystems/public-custom-404-plugin/blob/main/first_snippet.xsl
https://github.com/dawud-outsystems/public-custom-404-plugin/blob/main/second_snippet.xsl
https://github.com/dawud-outsystems/public-custom-404-plugin/blob/main/third_snippet.xsl
https://github.com/dawud-outsystems/public-custom-404-plugin/blob/main/CustomErrorHandler.xsl
This doesn't seem to be working as expected. Does anyone else have any advice on how to do this? All I can think is to write some deployment code to target the "_error.html" pages in the directories of the front-end phone apps that will be getting converted and replace them with some other file.
I'd have to run that every time I published, though, so looking for a better solution if there is one.
Hi Eric,
this answer is coming probably too late for you but maybe on time for others facing a similar problem.
It is possible to redirect the user to a custom "_error.html" page in the case of a reactive web app. Check this article: https://blog.product-league.com/how-to-customize-the-outsystems-reactive-web-app-error-screen-ecac5c29fb18
In case you want to customize the default error page of a mobile app, this is also possible. Check these articles:
https://blog.product-league.com/how-to-customize-your-outsystems-app-error-screen-like-a-pro-part-1-2006dc82c369
https://blog.product-league.com/how-to-customize-your-outsystems-app-error-screen-like-a-pro-part-2-c8c5940d83e2
https://blog.product-league.com/how-to-customize-your-outsystems-app-error-screen-like-a-pro-part-3-5c01681ce801