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

Fix MissingFieldException duplication #2213

Merged
merged 2 commits into from Feb 28, 2023
Merged

Fix MissingFieldException duplication #2213

merged 2 commits into from Feb 28, 2023

Conversation

qwwdfsad
Copy link
Member

Fixes #2212

@@ -87,6 +87,9 @@ internal open class StreamingJsonDecoder(
return result

} catch (e: MissingFieldException) {
// Add "at path" if and only if we've just caught an exception and it hasn't been augmented yet
if (e.message!!.contains("at path")) throw e
// NB: we could've use some additional flag marker or augment the stacktrace, but it seemed to be as too much of a burden
throw MissingFieldException(e.missingFields, e.message + " at path: " + lexer.path.getPath(), e)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer val mfe = .. new mfe with better message ... to later do mfe.stackTrace = e.stackTrace, but unfortunately, it works only on JVM, not sure if we should bother

@qwwdfsad qwwdfsad merged commit cbd8ce3 into dev Feb 28, 2023
@qwwdfsad qwwdfsad deleted the fix-mfe-duplication branch February 28, 2023 14:47
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

Successfully merging this pull request may close these issues.

None yet

2 participants