Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server message to user-facing error on 429 for tunnel creation #185600

Merged
merged 3 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/src/commands/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ pub enum TunnelSubcommand {
/// Restarts any running tunnel on the system.
Restart,

/// Gets whether there is a tunnel running on the current machineiou.
/// Gets whether there is a tunnel running on the current machine.
Status,

/// Rename the name of this machine associated with port forwarding service.
Expand Down
10 changes: 9 additions & 1 deletion cli/src/tunnels/dev_tunnels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,17 @@ impl DevTunnels {
continue;
}

if let Some(d) = e.get_details() {
let detail = d.detail.unwrap_or_else(|| "unknown".to_string());
return Err(AnyError::from(TunnelCreationFailed(
name.to_string(),
detail,
)));
}

return Err(AnyError::from(TunnelCreationFailed(
name.to_string(),
"You've exceeded the 10 machine limit for the port fowarding service. Please remove other machines before trying to add this machine.".to_string(),
"You have exceeded a limit for the port fowarding service. Please remove other machines before trying to add this machine.".to_string(),
)));
}
Err(e) => {
Expand Down