pingcap / errors Goto Github PK
View Code? Open in Web Editor NEWThis project forked from pkg/errors
Simple error handling primitives
Home Page: https://godoc.org/github.com/pkg/errors
License: BSD 2-Clause "Simplified" License
This project forked from pkg/errors
Simple error handling primitives
Home Page: https://godoc.org/github.com/pkg/errors
License: BSD 2-Clause "Simplified" License
%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: ""
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.
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:
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.
our upstream have change a lot, go1.12 introduce new stack frame we should follow up them.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.