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: issue with uncaught UnicodeDecodeError #107

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

vinitkumar
Copy link
Owner

@vinitkumar vinitkumar commented Feb 10, 2022

Even though, there are methods to safely get the json from file, string,
or url even, there is no surely that people will not pass their own data
into the json2xml.Json2xml() contructor.

However, if the data is corrupt or mal-formed, there is a chance an
exception can be raised, bringing the program to a halt.

Hence, a new error type is introduced, that protects against it and
raises InvalidDataError exception which can that be caught and logged in
a program that uses Json2xml.

Authored-by: Vinit Kumar mail@vinitkumar.me
Signed-off-by: Vinit Kumar mail@vinitkumar.me

Even though, there are methods to safely get the json from file, string,
or url even, there is no surely that people will not pass their own data
into the json2xml.Json2xml() contructor.

However, if the data is corrupt or mal-formed, there is a chance an
exception can be raised, brining the program to a halt.

Hence, a new error type is introduced, that protects against it and
raises InvalidDataError exception which can that be caught and logged in
a program that uses Json2xml.

- Github Issue: #106

Authored-by: Vinit Kumar <mail@vinitkumar.me>
Signed-off-by: Vinit Kumar <mail@vinitkumar.me>
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 10, 2022

This pull request introduces 1 alert when merging 194ecbe into 8a996f1 - view on LGTM.com

new alerts:

  • 1 for Unused import

@vinitkumar vinitkumar merged commit dc8f15f into master Feb 10, 2022
@vinitkumar vinitkumar deleted the fix/protect-against-bad-data-exception branch February 10, 2022 17:19
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

1 participant