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

Exception handling during parsing #12

Closed
Dahausa opened this issue Sep 30, 2019 · 5 comments
Closed

Exception handling during parsing #12

Dahausa opened this issue Sep 30, 2019 · 5 comments

Comments

@Dahausa
Copy link

Dahausa commented Sep 30, 2019

Hi,

first of all, thanks for this library. :)
I haven't found any other doing the same thing you do with your library.
I'm considering to use it in an application.

But one thing that prevents me from using it is the fact how exceptions are handled.

Every exception during parsing is caught inside the try/catch.
So a client using the library doen't know that something went wrong. :-(

In my opinion it'll be helpfull to propagate any exception as a runtime exception to clients in order that the client is able to react on that exception.

What I propose is...

to change this:

} catch (SAXException | IOException | ParserConfigurationException e) {
     Logger.getAnonymousLogger().log(Level.SEVERE, "Exception while parsing.", e);
}

into this:

} catch (SAXException | IOException | ParserConfigurationException e) {
     Logger.getAnonymousLogger().log(Level.SEVERE, "Exception while parsing.", e);
      throw new RuntimeException(e);
}

What do you think?
Shall I submit a pull request to change this?

@lcduarte
Copy link
Member

Hi,

Thanks for using it! :)

Sure, I can make that change. I'll try to perform a new release today or maybe tomorrow if I can.

@lcduarte
Copy link
Member

I performed a new release, 1.0.22. If you notice anything else feel free to open another issue :)

@Dahausa
Copy link
Author

Dahausa commented Sep 30, 2019

That was fast! Thanks :)

@fmcarvalho fmcarvalho reopened this Oct 1, 2019
@fmcarvalho
Copy link
Member

@Dahausa I noticed that you are not a XsdParser stargazer yet. Could you please give a star to increase popularity. Thanks

@Dahausa
Copy link
Author

Dahausa commented Oct 1, 2019

Sure! You got a new star :)

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

No branches or pull requests

3 participants