drill icon indicating copy to clipboard operation
drill copied to clipboard

DRILL-4586: Add ErrorType#CLIENT to UserException for client side errors

Open sudheeshkatkam opened this issue 9 years ago • 7 comments

  • Resolve relevant TODOs

@parthchandra please review.

sudheeshkatkam avatar Aug 11 '16 00:08 sudheeshkatkam

Per my understanding User Exception was meant for errors on the server side that are to bet sent back to the user. Are you extending that definition?

parthchandra avatar Aug 31 '16 20:08 parthchandra

This also breaks client/wire compatibility. In previous discussions, we said that we would avoid breaking compatibility. If you proceed with this, you'll need to add a compatibility layer in the server that understands the different client versions and whether a server can return this value on the wire.

jacques-n avatar Aug 31 '16 21:08 jacques-n

Per Hakim's comment, SYSTEM type is meant for unexpected errors that do not have a "nice" error message yet. However in some error cases on the client side, there can be nice error messages, as shown in these changes.

Regarding compatibility: the server should not produce CLIENT type user exceptions, so old clients can talk to new servers; mentioned in the CLIENT type description as some error on the client side.

sudheeshkatkam avatar Aug 31 '16 22:08 sudheeshkatkam

It seems error-prone/dangerous to change the wire protocol for something that will never be sent on the wire.

jacques-n avatar Aug 31 '16 22:08 jacques-n

For now, I am not sure how else to fix this; will punt until compatibility later is introduced.

sudheeshkatkam avatar Aug 31 '16 22:08 sudheeshkatkam

Since it is all on the client/in the same jvm, why not just throw an exception and catch it? No need to jump through all the hoops that UserException goes through since you're never trying to propagate between multiple nodes.

jacques-n avatar Aug 31 '16 23:08 jacques-n

I am confused here. The patch enhances the catch clauses of thrown exceptions and, in a way, "corrects" what was being reported to the user as a SYSTEM (server) error to CLIENT error since these exceptions happened on the client side (abd eventually a UserException needs to be reported).

I tried to extend UserException to ClientException, but no contextual information can be added because of how the UserException.Builder is setup. I will punt this.

sudheeshkatkam avatar Sep 01 '16 01:09 sudheeshkatkam