Categorygithub.com/ParaServices/errgo
modulepackage
0.10.0
Repository: https://github.com/paraservices/errgo.git
Documentation: pkg.go.dev

# README

errgo

Is an opinionated and requirement specific implementation for error handling with Para's golang applications.

This package wraps the errorx which allows paralog to log the error as a zapcode.Object which represents the error in a human readable format (JSON or string).

features

  • Wrap errorx
  • Assign error ID
  • Assign error code
  • Assign message
  • allow to add details for more information
  • verbosely log pq.Error
  • verbosely log googleapi.Error
  • verbosely log amqp.Error
package main

import (
    "encoding/json"
    "fmt"

    "github.com/ParaServices/errgo"
)

func main() {
    var i interface{}
    err := json.Unmarshal([]byte(`{`), &i)
    if err != nil {
      errx := errgo.New(err)
      errx.Code = "some code"
      errx.Message = "some message"
      fmt.Printf("ID: %s", errx.ID)
    }
}

# Functions

New ...
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

AMQPError represents the error from the amqp package.
Error ...
GoogleAPIError represents the error that is returned from the googleapi package.
PQError represents the error from the pq package.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

Details represents the additional details for a given error (metadata).
No description provided by the author
No description provided by the author