Skip to main content

onPanelEvent

A panel's event for your channel, keyed by the event's name.

Type​

assocArray: { <event name>: data }

Example​

m.maestro.observeField("onPanelEvent", "onMaestroPanelEvent")

sub onMaestroPanelEvent(event as object)
panelEvent = event.getData()
if panelEvent?.error?.payload?.code = 401
refreshHeaders(panelEvent.error.payload.details.panel)
end if
end sub

Expired credentials (401)​

When a panel's request is answered 401, the SDK sends one error event per refresh cycle, whichever panels hit it.

FieldTypeDescription
error.typestring"general:error"
error.timestampstringISO 8601 time of the error
error.payload.messagestringThe error message
error.payload.codeinteger401
error.payload.details.panelstringThe panel type that got the 401
error.payload.details.urlstringThe URL that answered 401

Answer with fresh credentials through setDataToPanel, in the field the panel documents. Until then the field headerRefreshInFlight is true and panels hold their requests. After three cycles without a successful request, the SDK stops sending the event and the panel shows its own error.

Notes​