marten_raven_middleware
Version, currently 0.1.01 version
- 0.1.0latestAug 16, 2023
github.com/ellmetha/marten-raven-middleware
A Marten middleware for Raven.cr.
Installation
# Add this to your shard.yml
dependencies:
marten_raven_middleware:
github: ellmetha/marten-raven-middleware
version: ~> 0.1.0Then run:
shards installshard.yml
- Crystal
>= 1.6.0- License
- MIT
- Author
- Morgan Aubert
Dependencies
Runtime Dependencies
Development Dependencies
- ameba*github: crystal-ameba/ameba, branch: masterdev
README
Marten Raven Middleware
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.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Aug 16, 2023
- Commit
d2ab085056b6- Crystal
>= 1.6.0- Indexed
- yes
Dependents
Repository
github.com/ellmetha/marten-raven-middleware
Metadata
- Created
- Aug 12, 2026
- Updated
- Nov 8, 2026
- Synced
- Nov 6, 2026
- Versions
- 1