Skip to content

Commit ea97852

Browse files
Add server message to user-facing error on 429 for tunnel creation (microsoft#185600)
* Add server message to user-facing error on 429 for tunnel creation * Update cli/src/tunnels/dev_tunnels.rs Co-authored-by: Connor Peet <[email protected]> * fix lint error --------- Co-authored-by: Connor Peet <[email protected]>
1 parent 0f8598b commit ea97852

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cli/src/commands/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ pub enum TunnelSubcommand {
611611
/// Restarts any running tunnel on the system.
612612
Restart,
613613

614-
/// Gets whether there is a tunnel running on the current machineiou.
614+
/// Gets whether there is a tunnel running on the current machine.
615615
Status,
616616

617617
/// Rename the name of this machine associated with port forwarding service.

cli/src/tunnels/dev_tunnels.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,17 @@ impl DevTunnels {
471471
continue;
472472
}
473473

474+
if let Some(d) = e.get_details() {
475+
let detail = d.detail.unwrap_or_else(|| "unknown".to_string());
476+
return Err(AnyError::from(TunnelCreationFailed(
477+
name.to_string(),
478+
detail,
479+
)));
480+
}
481+
474482
return Err(AnyError::from(TunnelCreationFailed(
475483
name.to_string(),
476-
"You've exceeded the 10 machine limit for the port fowarding service. Please remove other machines before trying to add this machine.".to_string(),
484+
"You have exceeded a limit for the port fowarding service. Please remove other machines before trying to add this machine.".to_string(),
477485
)));
478486
}
479487
Err(e) => {

0 commit comments

Comments
 (0)