Comments (7)
For instance you will be able to correctly use errors.As
from the standard golang "errors"
from json-patch.
+1
from json-patch.
Shameless plug: you can also switch it to drop-in replacement gitlab.com/tozd/go/errors
. It fixes many issues, is maintained, and supports modern Go's error patterns (sentinel errors, %w formatting, joined errors, etc.). It also provides some nice utility functions and structured details so that it is easy to extract dynamic data out of errors (instead of trying to get them out of formatted strings). Has improved error formatting and JSON marshaling of errors. It is interoperable with other errors packages and does not require a dependency on itself to extract data (e.g., stack trace) from errors.
from json-patch.
I don't really see a reason to switch honestly. Sure it's it maintenance mode, but it's not hurting anything. What would be gained by changing?
from json-patch.
That's only for the code within json-patch to use As
. Is there a place where you think that's warranted? I don't recall want to do an upgrade just for upgrades sake unless there are reasons that improve the functionality of the code.
from json-patch.
For instance we are validating a set of patches in advance before applying all or them or nothing and we want to ignore/tolerate failures on test
operations.
Currently we are doing:
// tolerate jsonpatch test failures
if err != nil && !errors.Is(errors.Unwrap(err), jsonpatch.ErrTestFailed) {
return err
}
as errors.As
from "errors"
is not working in that case.
Another option would be about introducing something like AllowMissingPathOnTest
or AllowTestFailures
in jsonpatch.ApplyOptions
.
from json-patch.
I prefer errors.Wrapf
as an API honestly, so I think I'm just going to keep it for now.
from json-patch.
Related Issues (20)
- Performance Degradation Starting In v5.2.0 HOT 2
- Invalid spec implementation
- RFC Link in README.md returns a 404 error
- nil dereference on empty "replace" on root
- RFC6902 limitations when the document structure is not known in advance HOT 2
- Panic when adding to a non-existing array HOT 1
- jsonpatch.Equal : strange behavior on handling literal unicode string equality HOT 1
- replace operation does not apply: doc is missing path: missing value HOT 2
- Is this project still maintained:) HOT 1
- Add validation for pre-flight checks HOT 6
- Unable to access invalid index: 1: invalid index referenced HOT 2
- Can not run "add" on root object
- CreateMergePatch: Numbers may get truncated due to always being treated as float64 HOT 3
- move fails with "missing value" if from is "" HOT 4
- `>` character is not decoded properly when applying json patches HOT 3
- Regression in 5.8.0: cannot create `jsonpatch.Operation` object HOT 6
- add on `null` does not work anymore ? HOT 10
- For V4 and V5, the apply results of the values that do not exist in replace are inconsistent. HOT 1
- Dependency github.com/pkg/errors was archived
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-patch.