Hi everyone,
I have followed this article to setup a custom error for my portal, this is what I had done:
1. Go to Portal Actions > Enable custom errors.
2. Go to Portal Management > Content Snippets > Create a new snippet named Portal Generic Error using my custom HTML.
Now, I want to test if my custom error is working and showing correctly.
However, I don't know how to create an error for testing purpose of this custom error.
Can anyone help me to break my portal for testing my custom error message?
Thank you and best regards,
Adrian Nguyen
You've correctly set up the custom error handling for your Power Apps portal. Now, you need a way to force an error to trigger the display of your "Portal Generic Error" content snippet.
Here's how you can create an error for testing purposes:
1. Using Web Page Access Control Rules (Simplest):
Explanation: This method forces an authorization error because no user (including anonymous) is allowed to read the page.
2. Using Liquid Template Errors (More Technical):
{{ unknown_variable }}
(references a non-existent variable){{ page | invalid_filter }}
(uses an invalid filter){% if page.unknown_property %}
(accesses a non-existent property)
Explanation: Liquid errors are caught by the portal's error handling and will trigger the generic error page.
3. Using JavaScript Errors (If Applicable):
undefined_variable.property;
(accesses a property of an undefined variable)throw new Error("Test Error");
(throws a custom error)Explanation: JavaScript errors can sometimes be caught by the portal's error handling, especially if they occur during the page's initial rendering.
Important Notes:
By using these methods, you should be able to trigger your custom error message and verify that it's working as expected. Choose the method that best fits your testing needs and technical comfort level.
HI,
If your problem is resolved, mark this thread verified so that it will be helpful for other community members.
If found helpful, Please mark my answer verified.
Found a way to break my portal: Add any html tag (example <p>) into an entity form and submit.
Any suggestion for this?
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Vahid Ghafarpour
136
Super User 2025 Season 1
Eugen Podkorytov
106