eventuo11y-batteries-0.2.0.0: Grab bag of eventuo11y-enriched functionality
CopyrightCopyright 2022 Shea Levy.
LicenseApache-2.0
Maintainershea@shealevy.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Observe.Event.Wai

Description

 
Synopsis

Application

application Source #

Arguments

:: EventBackend IO r ServeRequest 
-> (r -> Application)

The application, called with a reference to the parent event.

-> Application 

Run an Application with generic Request/Response instrumentation.

Instrumentation

data ServeRequest f where Source #

Event selector for application.

renderServeRequest :: RenderSelectorJSON ServeRequest Source #

Render a ServeRequest, and any Events selected by it, to JSON

setOnException

onExceptionCallback :: EventBackend IO r OnException -> Maybe Request -> SomeException -> IO () Source #

A setOnException callback which creates an Event rendering Exceptions.

Ideally this would have a way to get a parent Event from application. Would be nice to use vault, but there doesn't seem to be a way to get at the Request that Warp will pass here.

Instrumentation

data OnException f where Source #

Selector for onException

renderOnException :: Exception stex => RenderExJSON stex -> RenderSelectorJSON OnException Source #

Render an OnException, and its selected-for Events, as JSON, with a provided base structured exception type.

renderOnExceptionField :: Exception stex => RenderExJSON stex -> RenderFieldJSON OnExceptionField Source #

Render an OnExceptionField as JSON, with a provided base structured exception type.

Miscellaneous instrumentation

renderRequest :: Request -> Value Source #

Render a Request to JSON.