Coder Social home page Coder Social logo

errstack's Introduction

errstack

License: MIT Go Reference

A very small library to combine errors.

Furthermore, I want my errors to display the filename and line number.

pool.go:19="missing max value" users.go:25="missing password field"

Example

package main

import (
    "log"
)

func main() {
    // 1. Something bad happened at the beginning of your stack.
    e := errstack.New("password field is missing")

    // 2. And then the second error occured.
    e.Append("company name is missing")

    // 3. And then the third error occured.
    e.Append("username is too short")

    log.Println(e.Error())
    // The log will look like this:
    // /path/to/project.go:68="username is too short" /path/to/project.go:65="company name is missing" /path/to/project.go:15="password field is missing"
}

My other Go libraries

  • Tollbooth: A generic middleware to rate-limit HTTP requests.

  • Stopwatch: A small library to measure latency of things. Useful if you want to report latency data to Graphite.

  • LaborUnion: A dynamic worker pool library.

  • Gomet: Simple HTTP client & server long poll library for Go. Useful for receiving live updates without needing Websocket.

errstack's People

Contributors

didip avatar

Stargazers

07 avatar  avatar SeaRobber avatar sxwebdev avatar Ben avatar Hayato Tomoda avatar Ilmari Vacklin avatar Sameer Kolpekwar avatar Uğur Korkmaz avatar Orlando B avatar

Watchers

 avatar SeaRobber avatar  avatar  avatar

Forkers

softwarecheng

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.