1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Made builds.yml variable errors more helpful (#19066)

This commit is contained in:
Olaf Tomalka 2023-05-09 21:47:42 +02:00 committed by GitHub
parent 6e180af313
commit a1ff530430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,11 @@ class Variables {
assert(
value !== DeclaredOnly,
new TypeError(
`Tried to access a declared, but not defined environmental variable "${key}"`,
`Tried to access a declared, but not defined environmental variable "${key}"
\tWhy am I seeing this: "${key}" is declared in builds.yml, but had no actual value when we tried loading it.
\tHow do I fix this: You could provide a default value for the variable in builds.yml under "env" property and commit to git. For example:
\t\tenv:
\t\t - ${key}: ''`,
),
);
return value;
@ -46,7 +50,9 @@ class Variables {
assert(
this.isDeclared(key),
new TypeError(
`Tried to access an environmental variable "${key}" that wasn't declared in builds.yml`,
`Tried to access an environmental variable "${key}" that wasn't declared in builds.yml
\tWhy am I seeing this: We've made use of new variables be explicit to keep track of all of them in one place
\tHow do I fix this: Adding your variable in builds.yml under "env" property and committing to git will fix this`,
),
);
return this.#definitions.get(key);