Skip to content

KXmlParser throws top-level RuntimeException #10

Description

@amithilbuch

The KXmlParser class uses RuntimeExceptions when XmlPullParser doesn't declare a checked exception. This design choice is expected.
However, the class throws the top level RuntimeException (lines: 169, 180, 1130) instead of a more specific exception, which 'forces' clients to catch a RuntimeException, hiding the ability to detect errors from other parts of the code in the process.
One simple solution could be to throw a more specific KXmlParserRuntimeException to allow clients to catch only the errors thrown by the parser class. This would be backwards compatible with any client already catching the RuntimeException.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions