restate icon indicating copy to clipboard operation
restate copied to clipboard

Do not panic in CLI example command if interrupted

Open AhmedSoliman opened this issue 1 year ago • 0 comments

At the moment if we Ctrl+C when choosing an example, the CLI panics. We should just abort cleanly (see how we do this in deployment registration prompt for reference)

❯ restate example                                                                                                                                                                                                                                                                                                          ✘ 134
✔ Choose the programming language · Typescript
? Choose the example ›
  Ecommerce Store
  Food Ordering
  Hello World Lambda Cdk
  Hello World Lambda
  Payment Api
  Ticket Reservation

Ctrl-C pressed, aborting...
thread 'main' panicked at cli/src/commands/examples.rs:69:14:
called `Result::unwrap()` on an `Err` value: IO(Custom { kind: Interrupted, error: "read interrupted" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    58898 abort      restate example

AhmedSoliman avatar Jan 16 '24 10:01 AhmedSoliman