Skip to content

Commit

Permalink
feat(Variables): Report errors on unresolved variables
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Mar 30, 2021
1 parent 089405a commit f112e4b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/serverless.js
Expand Up @@ -564,6 +564,25 @@ const processSpanPromise = (async () => {
{ serviceConfig: configuration }
);
}
if (unresolvedSources.size) {
logDeprecation(
'NEW_VARIABLES_RESOLVER',
`Approached unrecognized configuration variable sources: "${Array.from(
unresolvedSources.keys()
).join('", "')}".\n` +
'From a next major this will be communicated with a thrown error.\n' +
'Set "variablesResolutionMode: 20210326" in your service config, ' +
'to adapt to new behavior now',
{ serviceConfig: configuration }
);
}
} else {
throw new ServerlessError(
`Approached unrecognized configuration variable sources: "${Array.from(
unresolvedSources.keys()
).join('", "')}"`,
'UNRECOGNIZED_VARIABLE_SOURCES'
);
}
})();

Expand Down

0 comments on commit f112e4b

Please sign in to comment.