Giter Club home page Giter Club logo

marten-raven-middleware's Introduction

Marten Raven Middleware

CI CI

Marten Raven Middleware provides a Raven.cr integration that allows you to get automatic error reporting for the Marten web framework by using a dedicated middleware.

Installation

Simply add the following entry to your project's shard.yml:

dependencies:
  marten_raven_middleware:
    github: ellmetha/marten-raven-middleware

And run shards install afterward.

Configuration

First, add the following requirement to your project's src/project.cr file:

require "marten_raven_middleware"

You should then ensure that Raven.cr is properly configured. In a Marten project, you'll likely create a config/initializers/raven.cr initializer where you require and configure the Raven client for your project. For example:

# config/initializers/raven.cr

require "raven"

Raven.configure do |config|
  config.dsn = "your_dsn"
end

To get automatic error reporting for your project, you then need to add the Raven::Marten::Middleware middleware class to the middleware Marten setting. Ideally, this middleware should be placed near the beginning of the middleware array to ensure that it can catch any errors raised by the following middlewares in the stack. For example:

# config/settings/base.cr

Marten.configure do |config|
  config.middleware = [
    Raven::Marten::Middleware,
    # Other middlewares...
    Marten::Middleware::GZip,
    Marten::Middleware::XFrameOptions,
    Marten::Middleware::StrictTransportSecurity,
  ]
end

That's it! From now on every exception that is raised by your handlers and middlewares will be reported to Sentry automatically.

Authors

Morgan Aubert (@ellmetha) and contributors.

License

MIT. See LICENSE for more details.

marten-raven-middleware's People

Contributors

ellmetha avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.