Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling in atomic_lib - specify and limit error types #11

Closed
joepio opened this issue Sep 13, 2020 · 6 comments
Closed

Error handling in atomic_lib - specify and limit error types #11

joepio opened this issue Sep 13, 2020 · 6 comments
Milestone

Comments

@joepio
Copy link
Member

joepio commented Sep 13, 2020

Current error is a dyn Box, which means it's impossible to expect what kind of error will be emitted. Let's limit with some Enum error type.

joepio added a commit that referenced this issue Sep 17, 2020
@joepio
Copy link
Member Author

joepio commented Jan 8, 2021

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)

@joepio
Copy link
Member Author

joepio commented Jan 8, 2021

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.

@joepio
Copy link
Member Author

joepio commented Jan 17, 2021

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.

joepio added a commit that referenced this issue Jan 17, 2021
@joepio
Copy link
Member Author

joepio commented May 9, 2021

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.

@joepio
Copy link
Member Author

joepio commented Jun 6, 2021

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.

@joepio
Copy link
Member Author

joepio commented Nov 14, 2021

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).

joepio added a commit that referenced this issue Nov 14, 2021
@joepio joepio closed this as completed Nov 14, 2021
joepio added a commit that referenced this issue Nov 16, 2021
joepio added a commit that referenced this issue Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant