Created
January 2, 2020 21:17
-
-
Save ewalk153/b2948b39b1873e4c0adf56aafcfe1d85 to your computer and use it in GitHub Desktop.
debugging middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dir["./app/middleware/*.rb"].each do |file| | |
| require file | |
| end | |
| config.middleware.use(::DebugMiddleware) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DebugMiddleware | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| return @app.call(env) | |
| rescue => err | |
| puts err.inspect | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment