forked from extern/nushell
Make HTTP requests cancellable when trying to connect (#8591)
Closes #8585. Prior to this change, the `http` commands could get stuck for 30s while attempting to make a connection to a remote server. After this change, `ctrl+c` works as expected:  To make this work, we perform blocking `ureq` calls in a background thread and poll the channel while checking `ctrl+c`.
This commit is contained in:
@ -1056,6 +1056,13 @@ pub enum ShellError {
|
||||
#[label("Could not access '{column_name}' on this record")]
|
||||
span: Span,
|
||||
},
|
||||
|
||||
/// Operation interrupted by user
|
||||
#[error("Operation interrupted by user")]
|
||||
InterruptedByUser {
|
||||
#[label("This operation was interrupted")]
|
||||
span: Option<Span>,
|
||||
},
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for ShellError {
|
||||
|
Reference in New Issue
Block a user