Closed emilien-puget closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.63%. Comparing base (
94c06b1
) to head (0c0c3fb
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
there is no relevant way to increase the code coverage for this change
there is no relevant way to increase the code coverage for this change
What about changing the design so that a failOnError
bool can be passed in to decide if it should return on any build errors, or continue going?
The reason why the coverage is failing is because it should not be a 'any failure results in total failure' scenario.
There could be many reasons why specific schemas failed to build or things went wrong deeper in the build tree, that is why there is an error returned. Just because one thing failed, it does not mean the rest of the model is toast. If there is a model, then you are good to go.
Here is where we would allow the consumer to decide if they want to fail at this point (return the error) or continue on.
To continue, would allow the circular reference check to pass (which is why errors may have returned, but the model knows how to handle them when building).
we could return when the model is nil instead of when any error is returned, allowing the consumer to generate a panic is not great
@daveshanley i changed the error handling to be more in sync with the previous behavior, while still being panic free
in some cases,
BuildV3Model
will return a nil first parameter and an error which result in a panic in the next call, this PR aims to fix this behavior.