Code Monkey home page Code Monkey logo

errors's People

Contributors

ailinkid avatar aleksi avatar chrishines avatar crazycs520 avatar davecheney avatar disksing avatar djui avatar exp avatar fabstu avatar gregwebs avatar ihrwein avatar judwhite avatar kennytm avatar lonng avatar lysu avatar msoap avatar mustafaakin avatar ncw avatar nicksnyder avatar nmiyake avatar scorredoira avatar sunrunaway avatar tangenta avatar tennyzhuang avatar thomasdezeeuw avatar tisonkun avatar tomsweeneyredhat avatar vbatts avatar xhebox avatar yujuncen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

errors's Issues

WithMessage and %q: not quoted

%q doesn't quote errors wrapped with errors.WithMessage. We get the same output as %s.

This is inconsistent with the usual behavior of %q and the implementation for other wrappers in this package which quote correctly.

Example on the Go Playground:

package main

import (
	stderrors "errors"
	"fmt"

	"github.com/pingcap/errors"
)

func main() {
	fmt.Printf("%s\n%[1]q\n", errors.WithMessage(stderrors.New(`quotes: ""`), `check "" quoting with %q`))
}

Output:

check "" quoting with %q: quotes: ""
check "" quoting with %q: quotes: ""

Error() method in withMessage is inappropriate

Current Error() method will print the log message first then with the error rfc code, it may be better to print the error rfc code in front of log message.

func (w *withMessage) Error() string  { return w.msg + ": " + w.cause.Error() }

In the case of BR

Error: backup meta file exists in file:////tmp/backup_test/backupmeta, there may be some backup files in the path already, please specify a correct backup directory!: [BR:Common:ErrInvalidArgument]invalid argument

Place [BR:Common:ErrInvalidArgument]invalid argument fieild in front of log message will be better.

fetch upstream to make this repo update to date with upstream?

it is said pkg/errors merged to go standard lib but some useful feature like stack trace not.
this makes pkg/errors still useful and i see pingcap/errors forked from it at year 2018,
and since then does not sync with upstream, and both this and upsream have more than 20 commits.

do you think it is meaningful or needed if i would like to do the sync job?

~/learn/go/errors @ master_upstream:master : git merge-base master master_upstream                                                                                                                                          
816c9085562cd7ee03e7f8188a1cfd942858cded

~/learn/go/errors @ master_upstream:master : git show 816c9085562cd7ee03e7f8188a1cfd942858cded 

commit 816c9085562cd7ee03e7f8188a1cfd942858cded (tag: pingcap_forked_here)
Author: Dave Cheney <[email protected]>
Date:   Mon Mar 12 08:45:15 2018 +1100

    travis.yml: add Go 1.10 (#154)

diff --git a/.travis.yml b/.travis.yml
index 7ca408d..15e5a19 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@ go:
   - 1.7.x
   - 1.8.x
   - 1.9.x
+  - 1.10.x
   - tip
 
 script:

v0.9.0 release

After #4 is merged, we should do a v0.9.0 release. That should help with using this version in place of pkg/errors with the help of dep.

Error() omits the cause of error

Unlike errors.Wrap, the (*Error).Wrap of RFC errors makes an error with a Error() method that wipes all the information the cause error has.

It would be good if we can reserve them.

Possible risk: some tests might fail?

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.