mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
improved port-forward error reporting (#4108)
* improved port-forward error reporting Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * satisfy lint and some autoformatting Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
1 parent
169f443c3b
commit
bbfb8372f3
5 files changed
+52
-39
No files matched your search
@@ -26,6 +26,7 @@ import { MenuActions, MenuActionsProps } from "../menu/menu-actions";
|
||||
import { MenuItem } from "../menu";
|
||||
import { Icon } from "../icon";
|
||||
import { PortForwardDialog } from "../../port-forward";
|
||||
import { Notifications } from "../notifications";
|
||||
|
||||
interface Props extends MenuActionsProps {
|
||||
portForward: PortForwardItem;
|
||||
@@ -35,7 +36,13 @@ interface Props extends MenuActionsProps {
|
||||
export class PortForwardMenu extends React.Component<Props> {
|
||||
@boundMethod
|
||||
remove() {
|
||||
return removePortForward(this.props.portForward);
|
||||
const { portForward } = this.props;
|
||||
|
||||
try {
|
||||
removePortForward(portForward);
|
||||
} catch (error) {
|
||||
Notifications.error(`Error occurred stopping the port-forward from port ${portForward.forwardPort}. The port-forward may still be active.`);
|
||||
}
|
||||
}
|
||||
|
||||
renderContent() {
|
||||
|
||||
Reference in new issue
Block a user