Code Monkey home page Code Monkey logo

Comments (7)

tiraboschi avatar tiraboschi commented on July 17, 2024 1

For instance you will be able to correctly use errors.As from the standard golang "errors"

from json-patch.

tiraboschi avatar tiraboschi commented on July 17, 2024

+1

from json-patch.

mitar avatar mitar commented on July 17, 2024

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.

evanphx avatar evanphx commented on July 17, 2024

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.

evanphx avatar evanphx commented on July 17, 2024

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.

tiraboschi avatar tiraboschi commented on July 17, 2024

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.

evanphx avatar evanphx commented on July 17, 2024

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)

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.