Skip to content

rgbrota/go-problemdetails-recoverer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ go-problemdetails-recoverer

License Build status Go Report Card

About

Problem details specification [RFC-7807] recoverer middleware library written in Go.

The objective of this middleware is to recover from panics gracefully and return a 500 Internal Server Error instead. The error response follows the problem details specification and looks like the following structure:

{
  "type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.6.1",
  "title": "Internal Server Error",
  "status": 500
}

For more information on how to be compliant with the specification, please see RFC-7807.

Installation

go get github.com/rgbrota/go-problemdetails-recoverer

Getting started

This repository contains a recoverer middleware compatible with net/http which recovers from panics and sends a problem details 500 Internal Server Error response instead.

In order to use it you only need to register it in the middleware chain, either by using the default configuration or by creating your own.

About

ProblemDetails specification [RFC-7807] (https://www.rfc-editor.org/rfc/rfc7807) recoverer middleware in Go

Topics

Resources

License

Stars

Watchers

Forks

Languages