use interrupted exception instead of just exception (#9092)

This commit is contained in:
William Cheng
2021-03-26 21:41:24 +08:00
committed by GitHub
parent 854296634a
commit 5abf020be3

View File

@@ -685,8 +685,10 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
} else {
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();
}
}
}