stricklandrbls commented on code in PR #1532:
URL: https://github.com/apache/daffodil-vscode/pull/1532#discussion_r2543672513
##########
src/daffodilDebugger/daffodilJars.ts:
##########
@@ -75,7 +76,21 @@ export async function downloadAndExtractToGlobalStorage(
try {
await downloadAndExtract('Daffodil CLI JARs', url, destFolder)
} catch (err) {
+ /**
+ * If 404 not found error, this means the daffodilVersion provided was
not valid.
+ * When an invalid version is given show the user a message, otherwise
log the error.
+ * When an error is hit return 'error' string.
+ * The error string makes it so the extension won't try to return the
debugger.
+ */
+ if (`${err}`.includes('404 Not Found')) {
+ vscode.window.showErrorMessage(
+ 'Invalid Daffodil Version. Check value set for
dfdlDebugger.daffodilVersion'
+ )
+ }
+
console.error(err)
+
+ return 'error'
Review Comment:
and given that this portion of the file is catching errors from the `fetch`
call:
https://github.com/shanedell/daffodil-vscode/blob/87d66d63791a06caf3e111189fec66157e0e238c/src/utils.ts#L520-L525
Should the conditional for the `err` string includes check for more than
just `404 Not Found`? For example, to test this I modified the `url` to be
invalid and it returns an error code that causes this conditional to fail and
not emit the vscode notification window.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]