Skip to content

Commit 1eace43

Browse files
committed
Properly swallow errors
1 parent 79b3362 commit 1eace43

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

src/commands/project.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,9 @@ export async function modifyProject(
737737
}
738738

739739
// Technically a project is a "document", so tell the server that we're opening it
740-
await new StudioActions()
741-
.fireProjectUserAction(api, project, OtherStudioAction.OpenedDocument)
742-
.catch(/* Swallow error because showing it is more disruptive than using a potentially outdated project definition */);
740+
await new StudioActions().fireProjectUserAction(api, project, OtherStudioAction.OpenedDocument).catch(() => {
741+
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
742+
});
743743

744744
let items: ProjectItem[] = await api
745745
.actionQuery("SELECT Name, Type FROM %Studio.Project_ProjectItemsList(?,?) WHERE Type != 'GBL'", [project, "1"])

src/commands/unitTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ async function childrenForServerSideFolderItem(
279279
// Technically a project is a "document", so tell the server that we're opening it
280280
await new StudioActions()
281281
.fireProjectUserAction(api, params.get("project"), OtherStudioAction.OpenedDocument)
282-
.catch(/* Swallow error because showing it is more disruptive than using a potentially outdated project definition */);
282+
.catch(() => {
283+
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
284+
});
283285
query =
284286
"SELECT DISTINCT CASE " +
285287
"WHEN $LENGTH(SUBSTR(Name,?),'.') > 1 THEN $PIECE(SUBSTR(Name,?),'.') " +

src/explorer/models/projectNode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export class ProjectNode extends NodeBase {
1818
// Technically a project is a "document", so tell the server that we're opening it
1919
const api = new AtelierAPI(this.workspaceFolderUri);
2020
api.setNamespace(this.namespace);
21-
await new StudioActions()
22-
.fireProjectUserAction(api, this.label, OtherStudioAction.OpenedDocument)
23-
.catch(/* Swallow error because showing it is more disruptive than using a potentially outdated project definition */);
21+
await new StudioActions().fireProjectUserAction(api, this.label, OtherStudioAction.OpenedDocument).catch(() => {
22+
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
23+
});
2424

2525
node = new ProjectRootNode(
2626
"Classes",

src/providers/FileSystemProvider/FileSearchProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
2626
// Technically a project is a "document", so tell the server that we're opening it
2727
await new StudioActions()
2828
.fireProjectUserAction(new AtelierAPI(options.folder), params.get("project"), OtherStudioAction.OpenedDocument)
29-
.catch(/* Swallow error because showing it is more disruptive than using a potentially outdated project definition */);
29+
.catch(() => {
30+
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
31+
});
3032
if (token.isCancellationRequested) {
3133
return;
3234
}

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
206206
// Technically a project is a "document", so tell the server that we're opening it
207207
await new StudioActions()
208208
.fireProjectUserAction(api, params.get("project"), OtherStudioAction.OpenedDocument)
209-
.catch(/* Swallow error because showing it is more disruptive than using a potentially outdated project definition */);
209+
.catch(() => {
210+
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
211+
});
210212
}
211213

212214
// Get all items in the project

src/providers/FileSystemProvider/TextSearchProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
400400
// Technically a project is a "document", so tell the server that we're opening it
401401
await new StudioActions()
402402
.fireProjectUserAction(api, params.get("project"), OtherStudioAction.OpenedDocument)
403-
.catch(/* Swallow error because showing it is more disruptive than using a potentially outdated project definition */);
403+
.catch(() => {
404+
// Swallow error because showing it is more disruptive than using a potentially outdated project definition
405+
});
404406
}
405407
if (token.isCancellationRequested) {
406408
return;

0 commit comments

Comments
 (0)