Skip to content
Snippets Groups Projects
Commit 46b05977 authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

Add handling of SSS server messages in gRPC

parent fd0ed36e
No related branches found
No related tags found
1 merge request!121Draft: Add server side scripting to gRPC API
Pipeline #62241 passed
......@@ -240,9 +240,43 @@ public class ServerSideScriptingServiceImpl extends ServerSideScriptingServiceIm
new StatusException(Status.NOT_FOUND.withDescription(description).withCause(e)));
return;
}
// TODO: SERVER_SIDE_DOES_NOT_EXIST, SERVER_SIDE_SCRIPT_NOT_EXECUTABLE,
// SERVER_SIDE_SCRIPT_ERROR, SERVER_SIDE_SCRIPT_SETUP_ERROR,
// SERVER_SIDE_SCRIPT_TIMEOUT, SERVER_SIDE_SCRIPT_MISSING_CALL
else if (e == ServerMessages.SERVER_SIDE_SCRIPT_DOES_NOT_EXIST)
{
responseObserver.onError(
new StatusException(Status.NOT_FOUND.withDescription(description).withCause(e)));
return;
}
else if (e == ServerMessages.SERVER_SIDE_SCRIPT_NOT_EXECUTABLE)
{
responseObserver.onError(
new StatusException(Status.PERMISSION_DENIED.withDescription(description).withCause(e)));
return;
}
else if (e == ServerMessages.SERVER_SIDE_SCRIPT_ERROR)
{
responseObserver.onError(
new StatusException(Status.UNKNOWN.withDescription(description).withCause(e)));
return;
}
else if (e == ServerMessages.SERVER_SIDE_SCRIPT_SETUP_ERROR)
{
responseObserver.onError(
new StatusException(Status.UNKNOWN.withDescription(description).withCause(e)));
return;
}
else if (e == ServerMessages.SERVER_SIDE_SCRIPT_TIMEOUT)
{
responseObserver.onError(
new StatusException(Status.DEADLINE_EXCEEDED.withDescription(description).withCause(e)));
return;
}
else if (e == ServerMessages.SERVER_SIDE_SCRIPT_MISSING_CALL)
{
responseObserver.onError(
new StatusException(Status.INVALID_ARGUMENT.withDescription(description).withCause(e)));
return;
}
e.printStackTrace();
responseObserver.onError(
new StatusException(Status.UNKNOWN.withDescription(description).withCause(e)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment