alamb commented on code in PR #8856:
URL: https://github.com/apache/arrow-datafusion/pull/8856#discussion_r1452279599
##########
datafusion-cli/src/main.rs:
##########
@@ -138,7 +139,7 @@ struct Args {
}
#[tokio::main]
-pub async fn main() -> Result<()> {
+pub async fn main() -> Result<(), DataFusionCLIError> {
Review Comment:
Rather than implementing an entire new error class just to reuse the
existing error handler, what do you think about handling the error explicitly?
Perhaps something like
```rust
#[tokio::main]
/// Handle errors in `main_inner`
pub async fn main() {
// print nice error and return error status from process on error
if let Err(e) = main_inner().await {
println!("Execution Error: {e}");
std::process:exit(1);
}
}
/// Main CLI entrypoint
async fn main_inner() -> Result<()> {
env_logger::init();
let args = Args::parse();
...
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]