Skip to content

DROP TABLE throws unchecked instead of SQLException (StatusRuntimeException) #70

@tekhedd

Description

@tekhedd

I'm not here to debate the general problem of Java APIs throwing unchecked exceptions, but in this case specifically, I would expect SQL errors to generate SQL exceptions, and definitely checked ones. :)

** What I did: **

client.sqlExec("DROP TABLE table_that_does_not_exist"); // table not found

alternatively:

client.sqlExec("DROP TABLE IF NOT EXIST anything"); // not supported

** What I Expect: **

SQLException

** What I got: **

io.grpc.StatusRuntimeException

I feel like the sqlExec call should catch and properly rephrase this as SQLException. (I can see how it could be missed, because unchecked. :) )

** EDIT **

Also applies to sqlQuery(). Hope this helps!

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