shanedell commented on code in PR #1532:
URL: https://github.com/apache/daffodil-vscode/pull/1532#discussion_r2546059705
##########
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:
Do you also think we should do the `error` string or actually just throw an
error about the URL being invalid? throwing an error would be more similar to
what the `downloadAndExtract` function is doing with the `fetch` it invokes.
--
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]