Module

Sentry.Raven

Package
purescript-sentry-raven
Repository
adamczykm/purescript-sentry-raven

Re-exports from Sentry.Raven.Breadcrumb

#X Source

data X

Newtype represeting lack of data and providing necessary instances.

Constructors

Instances

#Type Source

data Type

Represents possible types of a breadcrumb with special treatment from Sentry API

Constructors

Instances

#Level Source

data Level

Represents possible levels of a breadcrumb (specified by Sentry API)

Constructors

Instances

#BreadcrumbT Source

type BreadcrumbT a d = { category :: a, data :: Maybe d, level :: Maybe Level, message :: Maybe String, type :: Maybe Type }

Restricted record for aggregating breadcrumb data supported by Sentry API

#Breadcrumb' Source

type Breadcrumb' a = Breadcrumb a X

Breadcrumb type with no associated data

#Breadcrumb Source

newtype Breadcrumb a d

Breadcrumb type aggregating breadcrumb data supported by Sentry API

Constructors

Instances

#recordBreadcrumb' Source

recordBreadcrumb' :: forall d a ctx h. WriteForeign a => WriteForeign d => Raven h ctx -> Breadcrumb a d -> Effect Unit

Adds a breadcrumb to the current context. Notice that replacing context will cause recorded breadcrumbs to be dropped. You may also want to use 'recordBreadcrumb' from 'Sentry.Raven.Core' for non-restricted version of this function.

#breadcrumb Source

breadcrumb :: forall d a. a -> (BreadcrumbT a d -> BreadcrumbT a d) -> Breadcrumb a d

Allows for convenient creation of a restricted breadcrumb.

Re-exports from Sentry.Raven.Core

#Raven Source

data Raven :: Type -> Type -> Type

#Dsn Source

newtype Dsn

Newtype representing Sentry's Data Source Name

Constructors

#withUser Source

withUser :: forall a t2 t1 ctx h. WriteForeign { user :: t1 | ctx } => ReadForeign { user :: t1 | ctx } => Raven h { user :: t1 | ctx } -> t2 -> (forall h'. Raven h' { user :: t2 | ctx } -> Effect a) -> Effect a

Runs given effect with new user context. May change the type of the context.

#withRaven Source

withRaven :: forall opts ctx a. WriteForeign ctx => Dsn -> opts -> ctx -> (forall h. (Raven h ctx -> Effect a)) -> Effect a

Initializes Raven library and runs given effect in given Raven context, which allows to use the rest of the library function and automatically log uncaught exceptions. For more information about rejected promises, DSN, configuration options and contexts, please consult Raven library or Sentry documentation.

#withNewContext Source

withNewContext :: forall a ctx' ctx h. WriteForeign ctx => WriteForeign ctx' => ReadForeign ctx => ReadForeign ctx' => Raven h ctx -> ctx' -> (forall h'. Raven h' ctx' -> Effect a) -> Effect a

Runs given effect within a scope of new context. May change the type of the context.

#withChangedContext Source

withChangedContext :: forall a ctx' ctx h. WriteForeign ctx => WriteForeign ctx' => ReadForeign ctx => ReadForeign ctx' => Raven h ctx -> (ctx -> ctx') -> (forall h'. Raven h' ctx' -> Effect a) -> Effect a

Runs given effect within a scope of modified context. May change the type of the context.

#withAddedTags Source

withAddedTags :: forall a t3 t2 t1 ctx h. Union t2 t1 t3 => Nub t3 t3 => WriteForeign { tags :: Record t1 | ctx } => ReadForeign { tags :: Record t1 | ctx } => Raven h { tags :: Record t1 | ctx } -> Record t2 -> (forall h'. Raven h' { tags :: Record t3 | ctx } -> Effect a) -> Effect a

Adds given set of tags to the context and runs given effect within a scope of it. May change the type of the context.

#withAddedExtraContext Source

withAddedExtraContext :: forall a t3 t2 t1 ctx h. Union t2 t1 t3 => Nub t3 t3 => WriteForeign { extra :: Record t1 | ctx } => ReadForeign { extra :: Record t1 | ctx } => Raven h { extra :: Record t1 | ctx } -> Record t2 -> (forall h'. Raven h' { extra :: Record t3 | ctx } -> Effect a) -> Effect a

Runs given effect within a scope of additional extra context. May change the type of the context.

#setUser Source

setUser :: forall t1 ctx h. WriteForeign { user :: t1 | ctx } => ReadForeign { user :: t1 | ctx } => Raven h { user :: t1 | ctx } -> t1 -> Effect Unit

Replaces set user in the current Raven context.

#setTags Source

setTags :: forall t1 ctx h. WriteForeign { tags :: t1 | ctx } => ReadForeign { tags :: t1 | ctx } => Raven h { tags :: t1 | ctx } -> t1 -> Effect Unit

Replaces set of tags in the current Raven context.

#setExtraContext Source

setExtraContext :: forall t1 ctx h. WriteForeign { extra :: t1 | ctx } => ReadForeign { extra :: t1 | ctx } => Raven h { extra :: t1 | ctx } -> t1 -> Effect Unit

Replaces extra context data in the current Raven context.

#setContext Source

setContext :: forall ctx h. WriteForeign ctx => Raven h ctx -> ctx -> Effect Unit

Sets current Raven context. Notice that if you want to change the type of the context you should use 'withNewContext' function.

#recordBreadcrumb Source

recordBreadcrumb :: forall a r ctx h. WriteForeign { category :: a | r } => Raven h ctx -> { category :: a | r } -> Effect Unit

Adds a breadcrumb to the current context. Notice that replacing context will cause recorded breadcrumbs to be dropped. You may also want to use 'recordBreadcrumb'' from 'Sentry.Raven.Breadcrumb' for type-restricted version of this function.

#modifyUser Source

modifyUser :: forall t1 ctx h. WriteForeign { user :: t1 | ctx } => ReadForeign { user :: t1 | ctx } => Raven h { user :: t1 | ctx } -> (t1 -> t1) -> Effect Unit

Modifies set user in the current Raven context.

#modifyTags Source

modifyTags :: forall t1 ctx h. WriteForeign { tags :: t1 | ctx } => ReadForeign { tags :: t1 | ctx } => Raven h { tags :: t1 | ctx } -> (t1 -> t1) -> Effect Unit

Modifies set of tags in the current Raven context.

#modifyExtraContext Source

modifyExtraContext :: forall t1 ctx h. WriteForeign { extra :: t1 | ctx } => ReadForeign { extra :: t1 | ctx } => Raven h { extra :: t1 | ctx } -> (t1 -> t1) -> Effect Unit

Modifies extra context data in the current Raven context.

#modifyContext Source

modifyContext :: forall ctx h. WriteForeign ctx => ReadForeign ctx => Raven h ctx -> (ctx -> ctx) -> Effect Unit

Modifies current Raven context. Notice that if you want to change the type of the context you should use 'withChangedContext' function.

#getContext Source

getContext :: forall ctx h. ReadForeign ctx => Raven h ctx -> Effect ctx

Returns current Raven context.

#captureMessage Source

captureMessage :: forall extra msg ctx h. WriteForeign msg => WriteForeign extra => Raven h ctx -> msg -> extra -> Effect Unit

Logs non-exceptional behaviour of a program to given Raven instance. Parses msg argument as message and stores extra as additional data.

#captureException Source

captureException :: forall extra err ctx h. WriteForeign err => WriteForeign extra => Raven h ctx -> err -> extra -> Effect Unit

Logs exceptional behaviour of a program to given Raven instance. Parses err argument to message and stores extra as additional error data.

Re-exports from Sentry.Raven.Utils

#RavenFun2 Source

type RavenFun2 ctx i0 i1 o = forall h. Raven h ctx -> i0 -> i1 -> Effect o

Useful alias for explicit type annotations.

#RavenFun1 Source

type RavenFun1 ctx i o = forall h. Raven h ctx -> i -> Effect o

Useful alias for explicit type annotations.

#RavenFun0 Source

type RavenFun0 ctx o = forall h. Raven h ctx -> Effect o

Useful alias for explicit type annotations.

#RIx Source

data RIx

Represents path in a foreign object

Constructors

#readSub Source

readSub :: RIx -> Foreign -> F Foreign

Reads foreign object subobject at given path

#parseForeignNested' Source

parseForeignNested' :: forall a. ReadForeign a => List RIx -> Foreign -> Maybe a

Allows for convenient parsing of nested subobjects. Discards errors.

#parseForeignNested Source

parseForeignNested :: forall a. ReadForeign a => List RIx -> Foreign -> F a

Allows for convenient parsing of nested subobjects

#bool Source

bool :: forall a. a -> a -> Boolean -> a

Case analysis for the 'Boolean' type