Coder Social home page Coder Social logo

Comments (7)

rjrudin avatar rjrudin commented on June 11, 2024 1

Thanks @ralfhergert , I'll do some research on this today and get back to you soon.

from java-client-api.

rjrudin avatar rjrudin commented on June 11, 2024

@ralfhergert Sorry for the delay, still have analyzing this on my to-do list!

from java-client-api.

rjrudin avatar rjrudin commented on June 11, 2024

@ralfhergert Turns out we have several tests for this feature already - all of which are doing what you're doing too! We somewhat surprisingly don't have any subclasses of FailedRequestException yet, but I see no issue with starting that pattern.

There are two similar codes:

  • RESTAPI-CONTENTNOVERSION
  • RESTAPI-CONTENTWRONGVERSION

Full list of REST API error codes is at https://docs.marklogic.com/11.0/guide/messages/RESTAPI-en .

I am wondering if it would be beneficial to use class names of e.g. ContentNoVersionException and ContentWrongVersionException that don't attempt to abstract over the error code. Would those be self-documenting enough to achieve your goal of both 1) not having to do a string check, and 2) making your code easier to understand?

from java-client-api.

ralfhergert avatar ralfhergert commented on June 11, 2024

Hi @rjrudin, thanks for your response. Yes, the intended exceptions ContentNoVersionException and ContentWrongVersionException would work for us. They would achieve that we no longer have to implement the technical detail of "having to know the ML REST error strings". And they would allow us to catch the exceptions without further probing them for the underlying cause. - Looking forward to it. :)

from java-client-api.

rjrudin avatar rjrudin commented on June 11, 2024

Got it - we're doing a 6.2.1 release soon, I'm leaning towards sneaking this in even though it's technically a minor enhancement. The exception message won't change, just the class type, and it'll be a subclass of FailedRequestException.

from java-client-api.

rjrudin avatar rjrudin commented on June 11, 2024

Being addressed via #1590

from java-client-api.

rjrudin avatar rjrudin commented on June 11, 2024

Will be in 6.3.0, which will be released shortly.

from java-client-api.

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.