stricklandrbls commented on code in PR #1532:
URL: https://github.com/apache/daffodil-vscode/pull/1532#discussion_r2543650527
##########
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:
I would put it in the .ts file where it's being used.
I just noticed that the same should probably be done for the `throw` that's
attempting to be caught from the `downloadAndExtract` function.
--
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]