Skip to content

@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

ServiceError

Structured service error returned by the server (ServiceError). May be null when the failure is transport-level.

errorInfo?

RequestErrorInfo

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 error has a Message or Code, that text is shown directly.
  • When error is null and errorInfo.statusText === "abort", the error is silently ignored.
  • When responseText is HTML and errorMode is "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.