Skip to content
/ recover Public

Package recover contains basic functions which helps to work with recover in bit pleasant way.

License

Notifications You must be signed in to change notification settings

thepkg/recover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Recover

CircleCI Go Report Card godoc

Package recover contains basic functions which helps to work with recover in bit pleasant way.

Installation

go get -u github.com/thepkg/recover

Usage

import "github.com/thepkg/recover"

func f1() {
  defer recover.All(func(err interface{}) {
    fmt.Printf("got error: %s", err.(error))
  })
}

func f2() {
  defer recover.Any([]error{ErrorUsernameBlank, ErrorUsernameAlreadyTaken}, func(err interface{}) {
    fmt.Printf("got error: %s", err.(error))
  })
}

About

Package recover contains basic functions which helps to work with recover in bit pleasant way.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages