kubastick / ginception

Exception page middleware that look's like ASP.NET core one for Golang Gin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ginception - Catch panics like a pro

Build Status
This is exception page middleware that look's like ASP.NET core one for Golang Gin-Gionic

Features:

  • Stack trace of panic
  • Query URL
  • All cookies and their values
  • Request headers

Installation

go get github.com/kubastick/ginception
This package is following Go Mod (vgo) modules system

Usage

import (
  "github.com/kubastick/ginception"
  "github.com/gin-gonic/gin"
)

func main() {
  r := gin.Default()
  r.Use(ginception.Middleware()) // Attach ginception middleware
  r.GET("/", func(context *gin.Context) {
    panic("test panic")
  })
  r.Run(":7885")
}

About

Exception page middleware that look's like ASP.NET core one for Golang Gin

License:MIT License


Languages

Language:Go 100.0%