Code Monkey home page Code Monkey logo

Comments (6)

joepio avatar joepio commented on May 20, 2024

Types of errors probably look a lot like http errors, since it uses a lot of web concepts

  • Authorization (401): incorrect rights / signature
  • Not found (404): (part of) resource could not be resolved
  • Internal error (500)

from atomic-server.

joepio avatar joepio commented on May 20, 2024

AppError in Atomic-Server is pretty bad. It has some unused fields, unnecessary logic. Feels very unfinished. But perhaps it's better to fix that after fixing Atomic-Lib errors, since that's where pretty much all server errors will be coming from.

from atomic-server.

joepio avatar joepio commented on May 20, 2024

Current errors are often too verbose, and I don't have a decent strategy of solving this. Example:

 Failed setting propval for 'https://example.com/birthDate' because property 'https://atomicdata.dev/datatypes/Datatype' could not be found. Failed getting property https://atomicdata.dev/datatypes/Datatype. Could not fetch url 'https://atomicdata.dev/datatypes/Datatype'. Status: 500 

I currently use map_err + format! a lot to create long chained strings of errors. This is better than throwing information away, but I need a strategy to keep the messages shorter.

from atomic-server.

joepio avatar joepio commented on May 20, 2024

Also, I'd like to standardize these Errors even higher. Maybe introduce an Error class, and maybe give Error types resolvable, persistent IDs. At least I want front-end apps to be more aware of error types. Authentication errors might render a different component, etc.

from atomic-server.

joepio avatar joepio commented on May 20, 2024

I think We'll need Error Resources, which can be properly parsed and shown in the front-end. Maybe this will need to be a new Error type. Or maybe all we need is a different handler in server. Not sure what's the best approach here.

from atomic-server.

joepio avatar joepio commented on May 20, 2024

We now really need accurate status codes, because the front-end needs to know why requests have failed (authorization => retry when there's a new agent signed in).

from atomic-server.

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.