Skip to content

Commit

Permalink
chore: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
corker committed Apr 26, 2024
1 parent 616a48a commit c411c6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"eslint.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": true
}
10 changes: 9 additions & 1 deletion src/micromamba/makeEnvironmentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { combineLatest, concatMap, shareReplay } from "rxjs";
import { makeMicromambaParams } from "./makeMicromambaParams";
import { getMicromambaEnvVariables } from "./getMicromambaEnvVariables";
import { EnvironmentFailed, EnvironmentOK } from "./_definitions";
import { isNativeError } from "util/types";

interface Props {
ch: OutputChannel
Expand Down Expand Up @@ -33,7 +34,14 @@ export async function _makeEnvironmentInfo({ workspaceFolder, globalHomeDir, env
vars: await getMicromambaEnvVariables({ micromambaParams, environmentParams }),
ok: true,
} as EnvironmentOK
} catch (ignore) {
} catch (err) {
if (isNativeError(err)) {
ch.appendLine('Error: ' + err.message)
ch.appendLine('Stack: ' + err.stack)
} else {
ch.appendLine('Error: ' + err)
}
ch.show(true)
window.showErrorMessage(`Micromamba can't create ${environmentParams.name} environment`)
return {
...common,
Expand Down

0 comments on commit c411c6e

Please sign in to comment.