{"size": 1294, "ext": "scrbl", "max_stars_repo_path": "koyo-sentry.scrbl", "max_stars_repo_name": "Bogdanp/koyo-sentry", "max_stars_repo_stars_event_min_datetime": "2019-07-10T14:37:15.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-10T14:37:15.000Z", "max_issues_repo_path": "koyo-sentry.scrbl", "max_issues_repo_name": "Bogdanp/koyo-sentry", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "koyo-sentry.scrbl", "max_forks_repo_name": "Bogdanp/koyo-sentry", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 36.9714285714, "max_line_length": 153, "alphanum_fraction": 0.6105100464}
#lang scribble/manual

@(require (for-label racket/base
                     racket/contract
                     racket/string
                     sentry
                     web-server/http))

@author[(author+email "Bogdan Popa" "bogdan@defn.io")]
@defmodule[koyo/sentry]

@(define sentry-url "https://sentry.io")

This package provides a middleware that automatically sends exceptions
to @link[sentry-url]{Sentry} when they occur.

@section{Reference}

@defproc[((make-sentry-wrapper [dsn (or/c false/c non-empty-string?) #f]
                               [#:client client (or/c false/c sentry?) #f]
                               [#:backlog backlog exact-positive-integer? 128]
                               [#:release release (or/c false/c non-empty-string?) #f]
                               [#:environment environment (or/c false/c non-empty-string?) #f]) [hdl (-> request? response?)])  (-> request? response?)]{

  Creates a function that wraps a request handler so that any
  exceptions it raises get sent to Sentry.

  When @racket[client] is provided, all other arguments are
  disallowed.  Conversely, @racket[client] may not be provided when
  @racket[dsn] is provided.

  When either @racket[client] or @racket[dsn] is is @racket[#f],
  @racket[hdl] is returned unchanged.
}
