Skip to content

Conversation

bgaidioz
Copy link
Contributor

@bgaidioz bgaidioz commented Feb 26, 2025

If getting an INVALID_ARGUMENT error, the DETAIL includes a field called message that contains the details() string of the gRPC error, which is what the DASSdk exception message is: e.g.

if (v.getYear <= 2000) {
   throw new IllegalArgumentException(s"Invalid date: $v (only > 2000 supported)")
}

leads to this in the dictionary:

`"message": "Invalid date: year: 1999\nmonth: 1\nday: 1\n (only > 2000 supported)"`

The cause field is the full string representation of the originating exception:

ERROR:  Invalid argument
DETAIL:  {"code": "INVALID_ARGUMENT", "message": "Invalid date:
year: 1999\nmonth: 1\nday: 1\n (only > 2000 supported)", "das_name":
"localhost:50051", "das_type": "mock", "das_url": "localhost:50051",
"table_name": "events", "cause": "<_InactiveRpcError of RPC that
terminated with:\n\tstatus = StatusCode.INVALID_ARGUMENT\n\tdetails
= \"Invalid date: year: 1999\nmonth: 1\nday: 1\n (only > 2000
supported)\"\n\tdebug_error_string = \"UNKNOWN:Error received from
peer  {created_time:\"2025-02-26T15:06:31.645698+01:00\", grpc_status:3,
grpc_message:\"Invalid date: year: 1999\\nmonth: 1\\nday: 1\\n (only
> 2000 supported)\"}\"\n>"}

Same with PERMISSION_DENIED, UNAUTHENTICATED and UNIMPLEMENTED:

ERROR:  Permission denied
DETAIL:  {"code": "UNSUPPORTED_OPERATION", "message": "unsupported
operation", "das_name": "localhost:50051", "das_type": "mock",
"das_url": "localhost:50051", "table_name": "small", "cause":
"<_InactiveRpcError of RPC that terminated with:\n\tstatus =
StatusCode.UNIMPLEMENTED\n\tdetails = \"unsupported
operation\"\n\tdebug_error_string = \"UNKNOWN:Error received from
peer  {created_time:\"2025-02-26T15:37:37.095474+01:00\", grpc_status:12,
grpc_message:\"unsupported operation\"}\"\n>"}
ERROR:  Unauthenticated
DETAIL:  {"code": "UNAUTHENTICATED", "message": "Wrong password",                                                                                                                                   
"das_name": "localhost:50051", "das_type": "mock", "das_url":
"localhost:50051", "table_name": "events", "cause": "<_InactiveRpcError
of RPC that terminated with:\n\tstatus =
StatusCode.UNAUTHENTICATED\n\tdetails = \"Wrong
password\"\n\tdebug_error_string = \"UNKNOWN:Error received from
peer  {created_time:\"2025-02-26T15:16:37.598023+01:00\", grpc_status:16,
grpc_message:\"Wrong password\"}\"\n>"}
ERROR:  Unsupported operation
DETAIL:  {"code": "UNSUPPORTED_OPERATION", "message": "unsupported
operation", "das_name": "localhost:50051", "das_type": "mock",
"das_url": "localhost:50051", "table_name": "small", "cause":
"<_InactiveRpcError of RPC that terminated with:\n\tstatus =
StatusCode.UNIMPLEMENTED\n\tdetails = \"unsupported
operation\"\n\tdebug_error_string = \"UNKNOWN:Error received from
peer  {created_time:\"2025-02-26T15:37:37.095474+01:00\", grpc_status:12,
grpc_message:\"unsupported operation\"}\"\n>"}

@bgaidioz bgaidioz merged commit 2d97889 into main Feb 26, 2025
@bgaidioz bgaidioz deleted the strip-error-message branch February 26, 2025 15:42
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.

2 participants