@serenity-is/corelib / ErrorHandling / showServiceError
Function: showServiceError()
showServiceError(
error,errorInfo?,errorMode?):void
Defined in: src/base/errorhandling.tsx:28
Shows a service error to the user as an alert dialog or toast notification.
Parameters
error
Structured service error returned by the server (ServiceError). May be null when the failure is transport-level.
errorInfo?
Low-level request metadata (HTTP status, responseText, etc.). When error is falsy, this determines the fallback message.
errorMode?
Presentation mode. "notification" uses notifyError; any other value (or omitted) uses alertDialog / iframeDialog.
"alert" | "notification"
Returns
void
Remarks
- When
errorhas aMessageorCode, that text is shown directly. - When
errorisnullanderrorInfo.statusText === "abort", the error is silently ignored. - When
responseTextis HTML anderrorModeis"alert", it is rendered in an iframeDialog; otherwise it is shown as a notification. - In production, a "See browser console (F12)" hint is appended to generic HTTP errors.