Skip to content

Commit

Permalink
feat: error msg optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyinws committed Apr 25, 2024
1 parent d867c15 commit 2cd03f8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/core/server/launchEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,22 @@ export function launchEditor(specifiedEditor: Options['specifiedEditor']) {
}
}

launch(resolve(cwd(), `${filePath}:${line}:${column}`), specifiedEditor)
launch(resolve(cwd(), `${filePath}:${line}:${column}`), specifiedEditor, (fileName: any, errorMsg: any) => {
if (errorMsg) {
return {
status: 'error',
version,
message: String(errorMsg),
}
}
else if (fileName) {
return {
status: 'error',
version,
message: `Could not open ${fileName}`,
}
}
})
return {
status: 'success',
version,
Expand Down

0 comments on commit 2cd03f8

Please sign in to comment.