We're going to reuse a lot of this code for server endpoints. Refactor code to
prepare for that. I think it's overall a nice improvement :)
For successful generation, there are absolutely no changes in output. (This is
a standalone PR, so it's easy to see this.)
In error cases:
Since we encapsulate the different parts of parsing into their own types, there are some minor changes to the situations where we produce errors. Among the fixtures we have, there are a few outputs that change -- I think all for the better.
If the function is valid, but the metadata is not, we pass through the original function without doing any modifications to it. This leads to a much better experience for traits, and a slightly better one for functions.
Also add a little bit of error-handling infrastructure in the form of an
ErrorStore. This makes it reasonable to have this kind of nested
structure, where each component can determine whether it produced errors. We're
going to use this more extensively within the server macro, since that has
to maintain separate error contexts per endpoint.
As part of this, do_endpoint and do_channel no longer return Result types -- all errors are handled internally, and instead they return a pair of output and a list of errors. This resolves an inconsistency that I've been bothered by for a bit.
We're going to reuse a lot of this code for server endpoints. Refactor code to prepare for that. I think it's overall a nice improvement :)
For successful generation, there are absolutely no changes in output. (This is a standalone PR, so it's easy to see this.)
In error cases:
Also add a little bit of error-handling infrastructure in the form of an
ErrorStore
. This makes it reasonable to have this kind of nested structure, where each component can determine whether it produced errors. We're going to use this more extensively within the server macro, since that has to maintain separate error contexts per endpoint.As part of this,
do_endpoint
anddo_channel
no longer returnResult
types -- all errors are handled internally, and instead they return a pair of output and a list of errors. This resolves an inconsistency that I've been bothered by for a bit.Depends on #1007.