Restore interrupted state (#9084)

This commit is contained in:
William Cheng
2021-03-26 09:42:27 +08:00
committed by GitHub
parent ba28702da0
commit e71ae12e14
25 changed files with 54 additions and 2 deletions

View File

@@ -1271,6 +1271,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -333,6 +333,8 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -712,6 +712,8 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1125,6 +1125,8 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -833,6 +833,8 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1842,6 +1842,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -894,6 +894,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -751,6 +751,8 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -279,6 +279,8 @@ abstract public class AbstractPythonCodegen extends DefaultCodegen implements Co
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -253,6 +253,8 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -535,6 +535,8 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -858,6 +858,8 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -893,6 +893,8 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -885,6 +885,8 @@ public class CrystalClientCodegen extends DefaultCodegen {
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1459,6 +1459,8 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -696,6 +696,8 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -32,6 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.*;
import static org.openapitools.codegen.utils.StringUtils.*;
@@ -1134,8 +1135,10 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
}
LOGGER.info("Successfully executed: " + command);
} catch (Exception e) {
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1222,6 +1222,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
LOGGER.info("Successfully executed: " + command);
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -448,6 +448,8 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege
LOGGER.info("Successfully executed: " + command);
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -818,6 +818,8 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -624,6 +624,8 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1314,6 +1314,8 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}

View File

@@ -39,6 +39,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.*;
import java.util.Map.Entry;
@@ -1670,8 +1671,10 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
} else {
LOGGER.info("Successfully executed: {} {}", commandPrefix, file.toString());
}
} catch (Exception e) {
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({} ()). Exception: {}", commandPrefix, file.toString(), e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -977,6 +977,8 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}

View File

@@ -981,6 +981,8 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}