Giter VIP home page Giter VIP logo

Comments (7)

matthewd avatar matthewd commented on July 20, 2024 1

As long as it's still rescuable, I think it's probably fine? Technically even introducing and raising a subclass is an API change, but that seems like an over-constraint, especially right now while we can be pretty confident there are few downstreams to be potentially affected.

from trilogy.

casperisfine avatar casperisfine commented on July 20, 2024 1

Sounds good, I'll submit a PR tomorrow then.

from trilogy.

matthewd avatar matthewd commented on July 20, 2024

Yeah, I do like inheriting from the ruby core types where applicable, so the module approach sounds good to me.

What do you think of making Trilogy::Error itself a catch-all module for everything the gem can raise?

from trilogy.

casperisfine avatar casperisfine commented on July 20, 2024

What do you think of making Trilogy::Error itself a catch-all module for everything the gem can raise?

Would be great yes. For network clients l like to have a catch all like you suggest, then a base for everything "transcient" typically network issues, then another base for "invalid statements" type of errors.

If it's OK to change Trilogy::Error to be a module instead of a class, then I can do that.

from trilogy.

composerinteralia avatar composerinteralia commented on July 20, 2024

Looks like GitHub does have some tests in a few places that do raise Trilogy::Error.new, but we should be able to change those to raise a more specific error.

Changing it from a class to a module may have implications for the version number the next time we release.

from trilogy.

casperisfine avatar casperisfine commented on July 20, 2024

Changing it from a class to a module may have implications for the version number the next time we release.

Yeah, an alternative is to have a Trilogy::Errors module alonside.

from trilogy.

casperisfine avatar casperisfine commented on July 20, 2024

What do you think of making Trilogy::Error itself a catch-all module for everything the gem can raise?

So there's a bit of a problem with that one. Many errors are directly raised as Trilogy::Error directly from mysql error codes. So we'd need to distinguish between "client errors" and "server errors".

from trilogy.

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.