Skip to content

go-zoox/errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

errors - Simple Errors Wrapper

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/errors

Getting Started

package main

import (
    stderrors "errors"

    "github.com/go-zoox/errors"
)

func main() {
    err := f3()
    
    fmt.Println(err)
}

func f1() error {
    return errors.New("string1")
}

func f2() error {
    return errors.Wrap(f1(), "custom message f2")
}

func f3() error {
    return errors.Wrapf(f2(), "custom message f3 %s", "test")
}

Inspired by

  • PumpkinSeed/errors - Simple and efficient error package.
  • bnkamalesh/errors - A drop-in replacement for Go errors, with some added sugar! Unwrap user-friendly messages, HTTP status code, easy wrapping with multiple error types.
  • pkg/errors - imple error handling primitives.

License

GoZoox is released under the MIT License.

About

Simple Errors Wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages