-
Notifications
You must be signed in to change notification settings - Fork 12
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
Editoast error management #237
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Leo Valais <[email protected]>
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a first round, hope you like it. I'm really worried by the complexity of this macro and if there would be some other solution.
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
} | ||
``` | ||
|
||
### Anonymous enums |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's such a QoL improvement when magic is around:
- what will happen when types do not match and compiler errors start to kick in on variants that only exists in these
EnumX
types?
I believe that, indeed, all of these enums will be a lot of boilerplate code... but once written, not touch again and not a lot.
Also, I'm more for a incremental improvement. We only "think" it might be cumbersome... Let's not fix now, what might never be broken. Said differently, let's address QoL once we have identified a really problem.
I would drop this section personally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully agree. Writing error enums isn't fun, but with thiserror it isn't that cumbersome, and has the nice side effect of being usable without refering to same T2
variant...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point was to find a way to use them transparently by just using the implicit from()
that goes with the ?
operator. But after prototyping a bit I couldn't find a way to make that work with rust stable. anon_enum
not implementing From
either seems to confirm that. I kept the section with an explanation block on why we won't do it, just in case some Rust wizard comes by and magically find a solution... Cf. 717e31d
(#237)
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
} | ||
``` | ||
|
||
In order to be able to find and investigate the error later on, we associate to each `5xx` error a unique `incident` identifier. At first we'll just log the incident with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear what the use for this unique identifier. I would understand to have one if I could relate to other places where this identifier is shown. If the idea is to have that identifier so we can go to Datadog to find the entire related trace, then maybe this identifier can be the trace ID directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this identifier can be the trace ID directly
Do we have traceids when tracing isn't enabled? If not, maybe we should just specify it as some unique identifier, which may or may not be a trace id (and also, may or may not be a valid uuid too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against using trace IDs if we can have them when telemetry is disabled.
I'm not sure if it's concerning or not, but should we decide to do so, we'd leak some trace IDs to the frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the discussion we had during the PIP, I moved this in the "Rejected ideas" section, I'll let you resolve if its ok 717e31d
(#237)
- Dispose of a way to actually match on errors when they occur deeper in the stack | ||
- Tie the errors to the endpoint they originate from in the OpenAPI. | ||
- Separate the error definition and emission of their serailization. | ||
- Statuate on how we want to forward Core's errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have missed where we do rule on that in this document... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in ec3e8d2
(#237)
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Thanks for all the corrections! I'll get back to this document when I have some time, hopefully in the next iteration :) |
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
I've added a bit of content, especially an implementation plan and details about how to forward Core errors. |
Signed-off-by: Leo Valais <[email protected]>
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Serge Croisé <[email protected]>
Co-authored-by: Serge Croisé <[email protected]>
Co-authored-by: Serge Croisé <[email protected]>
Thanks for the corrections! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice introducing some new sections about "Issues of the old system" or "Implementation plan".
content/docs/reference/design-docs/editoast-errors/_index.en.md
Outdated
Show resolved
Hide resolved
Signed-off-by: Leo Valais <[email protected]>
Settling on this topic is necessary in order to go forward with the split in crates.