File tree Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -201,22 +201,28 @@ export default class BashServer {
201
201
const explainshellEndpoint = config . getExplainshellEndpoint ( )
202
202
if ( explainshellEndpoint ) {
203
203
this . connection . console . log ( `Query ${ explainshellEndpoint } ` )
204
- const response = await this . analyzer . getExplainshellDocumentation ( {
205
- params,
206
- endpoint : explainshellEndpoint ,
207
- } )
204
+ try {
205
+ const response = await this . analyzer . getExplainshellDocumentation ( {
206
+ params,
207
+ endpoint : explainshellEndpoint ,
208
+ } )
208
209
209
- if ( response . status === 'error' ) {
210
- this . connection . console . log (
211
- `getExplainshellDocumentation returned: ${ JSON . stringify ( response , null , 4 ) } ` ,
212
- )
213
- } else {
214
- return {
215
- contents : {
216
- kind : 'markdown' ,
217
- value : new TurndownService ( ) . turndown ( response . helpHTML ) ,
218
- } ,
210
+ if ( response . status === 'error' ) {
211
+ this . connection . console . log (
212
+ `getExplainshellDocumentation returned: ${ JSON . stringify ( response , null , 4 ) } ` ,
213
+ )
214
+ } else {
215
+ return {
216
+ contents : {
217
+ kind : 'markdown' ,
218
+ value : new TurndownService ( ) . turndown ( response . helpHTML ) ,
219
+ } ,
220
+ }
219
221
}
222
+ } catch ( error ) {
223
+ this . connection . console . warn (
224
+ `getExplainshellDocumentation exception: ${ error . message } ` ,
225
+ )
220
226
}
221
227
}
222
228
You can’t perform that action at this time.
0 commit comments