QueryError (Insight Engine)
QueryError (Insight Engine)
This is for:
DeveloperIn this article
The QueryError
controller allows to retrieve information about the current error returned by the search API, if any.
Example: query-error.fn.tsx
Methods
subscribe
Adds a callback that’s invoked on state change.
Parameters
-
listener:
() => void
A callback that’s invoked on state change.
Returns Unsubscribe
: A function to remove the listener.
Attributes
state
The state of the QueryError
controller.
Properties
-
error:
ErrorPayload | null
The current error for the last executed query, or
null
if none is present. -
hasError:
boolean
true
if there is an error for the last executed query andfalse
otherwise.
Initialize
buildQueryError
Creates an insight QueryError
controller instance.
Parameters
-
engine:
InsightEngine
The headless engine.
Returns QueryError
Related Types
Unsubscribe
Call signatures
-
(): void;