File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111} from "../services/settings.service" ;
1212import { git } from "../services/git.service" ;
1313import filesystem from "../services/filesystem.service" ;
14- import { DiffResultBinaryFile , DiffResultTextFile } from "simple-git" ;
14+ import { DiffResultTextFile } from "simple-git" ;
1515
1616const localLogger = createChildLogger ( "Addon" ) ;
1717
@@ -70,10 +70,17 @@ export class Addon {
7070 "module" ,
7171 CONFIG_FILENAME
7272 ) ;
73- const rawConfig = await filesystem . readFile ( configURI ) ;
74- const config = JSON . parse ( rawConfig ) ;
7573
76- return config as AddonConfig ;
74+ try {
75+ const rawConfig = await filesystem . readFile ( configURI ) ;
76+ const config = JSON . parse ( rawConfig ) ;
77+ return config as AddonConfig ;
78+ } catch ( e ) {
79+ localLogger . error (
80+ `Failed to read config.json file for ${ this . name } (${ e } )`
81+ ) ;
82+ throw e ;
83+ }
7784 }
7885
7986 public async update ( ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { WebVueMessage } from "../types/webvue";
77import { DEVELOPMENT_IFRAME_URL } from "../config" ;
88
99const localLogger = createChildLogger ( "WebVue" ) ;
10+ const commandLogger = createChildLogger ( "Command" ) ;
1011
1112export class WebVue {
1213 public static currentPanel : WebVue | undefined ;
@@ -242,7 +243,6 @@ export class WebVue {
242243 webview : vscode . Webview ,
243244 context : vscode . ExtensionContext
244245 ) {
245- const commandLogger = createChildLogger ( "Command" ) ;
246246
247247 return webview . onDidReceiveMessage ( ( message : WebVueMessage ) => {
248248 const command = message . command ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import VSCodeLogFileTransport from "./services/logging/vsCodeLogFileTransport";
55import { logger } from "./services/logging.service" ;
66import dayjs from "dayjs" ;
77import RelativeTime from "dayjs/plugin/relativeTime" ;
8- import { setSetting } from "./services/settings.service" ;
98import { setupGit } from "./services/git.service" ;
109
1110dayjs . extend ( RelativeTime ) ;
@@ -16,10 +15,9 @@ export async function activate(context: vscode.ExtensionContext) {
1615 // Register commands
1716 context . subscriptions . push (
1817 vscode . commands . registerCommand ( "lua.addon_manager.open" , ( ) => {
19- Promise . allSettled ( setupPromises ) . then ( ( ) =>
20- WebVue . render ( context )
21- ) ;
22- setSetting ( "Lua.workspace.checkThirdParty" , false ) ;
18+ Promise . allSettled ( setupPromises )
19+ . then ( ( ) => WebVue . render ( context ) )
20+ . catch ( ( e ) => logger . error ( e ) ) ;
2321 } )
2422 ) ;
2523 // Create log file transport and add to logger
You can’t perform that action at this time.
0 commit comments