mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add notification in renderer if lens protocol handler fails to find any routes (#2787)
- Add notifications on missing lens:// handlers, and invalid URIs - add notifications on unknown entity IDs Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
36e8888ecb
commit
5fd2d5501c
8 files changed
+273
-130
No files matched your search
+17
-9
@@ -93,8 +93,11 @@ if (!app.requestSingleInstanceLock()) {
|
||||
|
||||
for (const arg of process.argv) {
|
||||
if (arg.toLowerCase().startsWith("lens://")) {
|
||||
lprm.route(arg)
|
||||
.catch(error => logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl: arg }));
|
||||
try {
|
||||
lprm.route(arg);
|
||||
} catch (error) {
|
||||
logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl: arg });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,8 +107,11 @@ app.on("second-instance", (event, argv) => {
|
||||
|
||||
for (const arg of argv) {
|
||||
if (arg.toLowerCase().startsWith("lens://")) {
|
||||
lprm.route(arg)
|
||||
.catch(error => logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl: arg }));
|
||||
try {
|
||||
lprm.route(arg);
|
||||
} catch (error) {
|
||||
logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl: arg });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,9 +258,10 @@ autoUpdater.on("before-quit-for-update", () => blockQuit = false);
|
||||
app.on("will-quit", (event) => {
|
||||
// Quit app on Cmd+Q (MacOS)
|
||||
logger.info("APP:QUIT");
|
||||
appEventBus.emit({name: "app", action: "close"});
|
||||
appEventBus.emit({ name: "app", action: "close" });
|
||||
ClusterManager.getInstance(false)?.stop(); // close cluster connections
|
||||
KubeconfigSyncManager.getInstance(false)?.stopSync();
|
||||
LensProtocolRouterMain.getInstance(false)?.cleanup();
|
||||
cleanup();
|
||||
|
||||
if (blockQuit) {
|
||||
@@ -268,10 +275,11 @@ app.on("open-url", (event, rawUrl) => {
|
||||
// lens:// protocol handler
|
||||
event.preventDefault();
|
||||
|
||||
LensProtocolRouterMain
|
||||
.getInstance()
|
||||
.route(rawUrl)
|
||||
.catch(error => logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl }));
|
||||
try {
|
||||
LensProtocolRouterMain.getInstance().route(rawUrl);
|
||||
} catch (error) {
|
||||
logger.error(`${LensProtocolRouterMain.LoggingPrefix}: an error occured`, { error, rawUrl });
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user