In general, you can implement a custom error-handling mechanism to capture and persist technical details at the point where an error occurs. For example, by wrapping critical logic in microflows with proper error handling, you can log the execution step, timestamp, user context, and error message into a dedicated database table for diagnostics.
However, there is no supported way in Mendix to globally intercept or hook into all generic “An error has occurred” (Admin Error) pop-ups. For security and platform integrity reasons, Mendix does not expose a mechanism to centrally capture every client-side runtime error triggered by the framework itself.
As an alternative, it is recommended to implement an in-application “Report an Issue” mechanism. This allows users to submit contextual information about what they were attempting to do, at what stage the issue occurred, and optionally include additional details (e.g., screenshots or descriptions). This approach provides structured diagnostics without relying on unsupported client-side interception.
If this resolves the issue, please close the topic.
Your requirement is to intercept Mendix client‑side errors, detect when the Admin Error pop‑up appears, capture diagnostics (failed request, console logs, screenshot), and send them to Mendix for analysis.
There is no officially supported Mendix API that exposes internal client error events or lets you override the Admin Error dialog. The Mendix client does not currently provide hooks into its built‑in error renderer.
So the solution requires an architected extension layer, not a Mendix‑native feature.
You can use HTMLCanava to capture the screen by using JS if you want I can explain it more a bit.
Mendix does not expose a supported hook to intercept the standard Admin Error popup directly from the client runtime.
Because in your case the error happens before the request reaches Mendix Runtime (WAF / proxy block), Mendix logging and error handlers are never triggered.
So the correct approach is client-side global error monitoring, not Mendix error popup interception.
Add a small custom JavaScript action / widget and register:
window.onerror = function (message, source, lineno, colno, error) {
sendErrorToMendix({
message,
source,
lineno,
colno
});
};
window.addEventListener("unhandledrejection", function (event) {
sendErrorToMendix({
message: event.reason
});
});
This captures:
Override fetch / XHR:
const oldFetch = window.fetch;
window.fetch = async (...args) => {
const response = await oldFetch(...args);
if (!response.ok) {
sendErrorToMendix({
status: response.status,
url: args[0]
});
}
return response;
};
This detects 403 / WAF blocked requests even when Mendix never receives them.
Use:
html2canvas
inside JS action:
html2canvas(document.body).then(canvas => {
const image = canvas.toDataURL();
sendToNanoflow(image);
});
Send Base64 → Nanoflow → Microflow → Store in DB/FileDocument.
JS Action → Nanoflow → Microflow
Store:
Admin Error popup itself:
So interception must happen before popup rendering using browser listeners.
Most production Mendix apps use:
instead of building custom capture logic.
These automatically capture:
There is no supported Mendix hook for Admin Error popup, but the correct solution is:
This works even when WAF blocks requests before Mendix runtime.