Skip to content

Commit 6510832

Browse files
committed
FileDescriptorReader is a static classs, not an interface.
Signed-off-by: fjtirado <ftirados@redhat.com>
1 parent 75dd7ee commit 6510832

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

impl/grpc/src/main/java/io/serverlessworkflow/impl/executors/grpc/FileDescriptorReader.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
import org.slf4j.Logger;
3030
import org.slf4j.LoggerFactory;
3131

32-
public interface FileDescriptorReader {
32+
public class FileDescriptorReader {
3333

34-
Logger logger = LoggerFactory.getLogger(FileDescriptorReader.class);
34+
private static final Logger logger = LoggerFactory.getLogger(FileDescriptorReader.class);
3535

36-
static FileDescriptorContext readDescriptor(ExternalResourceHandler externalResourceHandler) {
36+
public static FileDescriptorContext readDescriptor(
37+
ExternalResourceHandler externalResourceHandler) {
3738
Path grpcDir =
3839
tryCreateTempGrpcDir()
3940
.orElseThrow(
@@ -140,16 +141,18 @@ private static void generateFileDescriptorWithProcessBuilder(String[] protocArgs
140141
int exitCode = process.waitFor();
141142

142143
if (exitCode != 0) {
143-
throw new RuntimeException("Unable to generate file descriptor using system protoc.");
144+
throw new IllegalStateException(
145+
"Unable to generate file descriptor using system protoc. Exit code: " + exitCode);
144146
}
145-
146147
} catch (IOException e) {
147148
throw new UncheckedIOException(
148149
"Unable to execute system protoc. Please ensure 'protoc' is installed and available in your system PATH.",
149150
e);
150151
} catch (InterruptedException e) {
151152
Thread.currentThread().interrupt();
152-
throw new RuntimeException("Protoc execution was interrupted", e);
153+
throw new IllegalStateException("Protoc execution was interrupted", e);
153154
}
154155
}
156+
157+
private FileDescriptorReader() {}
155158
}

0 commit comments

Comments
 (0)