Skip to content

Commit

Permalink
fix(#962): improved error label when name is not defined while settin…
Browse files Browse the repository at this point in the history
…g env var
  • Loading branch information
helloanoop committed Nov 18, 2023
1 parent 4abb400 commit d2a99b0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
49 changes: 42 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/bruno-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@aws-sdk/credential-providers": "^3.425.0",
"@usebruno/js": "0.9.1",
"@usebruno/js": "0.9.2",
"@usebruno/lang": "0.9.0",
"@usebruno/schema": "0.6.0",
"about-window": "^1.15.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/bruno-js/src/bru.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Bru {

setEnvVar(key, value) {
if (!key) {
throw new Error('Key is required');
throw new Error('Creating a env variable without specifying a name is not allowed.');
}

// gracefully ignore if key is not present in environment
Expand All @@ -58,7 +58,7 @@ class Bru {

setVar(key, value) {
if (!key) {
throw new Error('A variable with an empty name has been created but name is required.');
throw new Error('Creating a variable without specifying a name is not allowed.');
}

if (envVariableNameRegex.test(key) === false) {
Expand Down

0 comments on commit d2a99b0

Please sign in to comment.