Giter VIP home page Giter VIP logo

Comments (6)

remi-dupre avatar remi-dupre commented on August 15, 2024

More generally, I think we want to map errors to a user-defined type.

This is not the first time that it seems that errors could use a special treatment, so maybe it would be a good idea to implement such a thing.

A simple way to handle it would be to add a boolean field is_error_type to enum definitions, however it doesn't explicit the fact that there must be one and exactly one of such type.

from stechec2.

seirl avatar seirl commented on August 15, 2024

however it doesn't explicit the fact that there must be one and exactly one of such type.

Is that something we want to enforce? I don't see why we couldn't have multiple error types for different functions.

from stechec2.

remi-dupre avatar remi-dupre commented on August 15, 2024

Is that something we want to enforce? I don't see why we couldn't have multiple error types for different functions.

I'm thinking about the error type attached to the API, which will be returned by actions. This "special" error type is passed as a template parameter to rules::Api here.

from stechec2.

seirl avatar seirl commented on August 15, 2024

Yes, I know that it got recently specialized to always work that way, I'm just not sure that's a good approach. Conceptually there is really no reason why all API functions should return the same error type.

from stechec2.

remi-dupre avatar remi-dupre commented on August 15, 2024

The logic around errors seems very short and quite easy to generalize indeed.

from stechec2.

juli0z avatar juli0z commented on August 15, 2024

Migrated to https://gitlab.com/prologin/tech/tools/stechec2/-/issues/143

from stechec2.

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.