MCPcopy Index your code
hub / github.com/dre1080/recovr

github.com/dre1080/recovr @v1.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.3 ↗ · + Follow
8 symbols 29 edges 6 files 1 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

recovr

godoc

Recovr is a HTTP middleware that catches any panics and serves a proper error response.

Works with all frameworks that support native http handler (eg. Fiber, Echo, Gin, Goji, etc.).

HTML

Installation

$ go get github.com/dre1080/recovr

Usage

package main

import (
    "log"
    "net/http"

    "github.com/dre1080/recovr"
)

var myPanicHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    panic("you should not have a handler that just panics ;)")
})

func main() {
    recovery := recovr.New()
    app := recovery(myPanicHandler)
    http.ListenAndServe("0.0.0.0:3000", app)
}

Examples

Fiber Example

import (
    "github.com/gofiber/fiber"
    "github.com/gofiber/adaptor"
)

func main() {
    app := fiber.New()
    app.Use(adaptor.HTTPHandler(recovr.New()))
    app.Listen(3000)
}

Gin Example

import "github.com/gin-gonic/gin"

func main() {
    g := gin.Default()
    g.Use(gin.WrapH(recovr.New()))
    g.Run()
}

Echo Example

import "github.com/labstack/echo/v4"

func main() {
    e := echo.New()
    e.Use(echo.WrapHandler(recovr.New()))
    e.Run(":3000")
}

Goji Example

import "github.com/zenazn/goji"

func main() {
    goji.Use(recovr.New())
    goji.Serve()
}

Screenshots

  • Logger

Logger

  • JSON

JSON

  • HTML

HTML

Core symbols most depended-on inside this repo

New
called by 1
recovr.go
mustReadFile
called by 1
util.go
mustReadLines
called by 1
util.go
getLines
called by 1
util.go
compileTemplate
called by 1
util.go
PanicHandler
called by 1
example/handlers/handlers.go
main
called by 0
example/main.go

Shape

Function 7
Struct 1

Languages

Go100%

Modules by API surface

util.go4 symbols
recovr.go2 symbols
example/main.go1 symbols
example/handlers/handlers.go1 symbols

For agents

$ claude mcp add recovr \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact