mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-23 15:58:50 -04:00
Various fixes
This commit is contained in:
@@ -11,10 +11,14 @@ public class ProcessOutputException extends Exception {
|
||||
return new ProcessOutputException(message, ex.getExitCode(), ex.getOutput());
|
||||
}
|
||||
|
||||
public static ProcessOutputException of(int exitCode, String output) {
|
||||
var messageSuffix = output != null && !output.isBlank()?": " + output : "";
|
||||
var message = exitCode == CommandControl.TIMEOUT_EXIT_CODE ? "Process timed out" + messageSuffix : "Process returned with exit code " + exitCode + messageSuffix;
|
||||
return new ProcessOutputException(message, exitCode, output);
|
||||
public static ProcessOutputException of(int exitCode, String output, String accumulatedError) {
|
||||
var combinedError = (accumulatedError != null ? accumulatedError.trim() + "\n" : "") + (output != null ? output.trim() : "");
|
||||
var message = switch (exitCode) {
|
||||
case CommandControl.KILLED_EXIT_CODE -> "Process timed out" + combinedError;
|
||||
case CommandControl.TIMEOUT_EXIT_CODE -> "Process timed out" + combinedError;
|
||||
default -> "Process returned with exit code " + combinedError;
|
||||
};
|
||||
return new ProcessOutputException(message, exitCode, combinedError);
|
||||
}
|
||||
|
||||
private final int exitCode;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package io.xpipe.core.store;
|
||||
|
||||
import io.xpipe.core.process.ShellControl;
|
||||
|
||||
public interface DelegateShellStore extends ShellStore {
|
||||
|
||||
@Override
|
||||
default ShellControl createControl() {
|
||||
return getDelegateHost().create();
|
||||
}
|
||||
|
||||
ShellStore getDelegateHost();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.xpipe.core.store;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface FixedHierarchyStore extends DataStore {
|
||||
|
||||
Map<String, DataStore> listChildren() throws Exception;
|
||||
}
|
||||
5
core/src/main/java/io/xpipe/core/store/LeafStore.java
Normal file
5
core/src/main/java/io/xpipe/core/store/LeafStore.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package io.xpipe.core.store;
|
||||
|
||||
public interface LeafStore extends DataStore {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user