mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
refactor(User Config): Show config save error only with SLS_DEBUG=*
It's to not confuse users with warnings which do not affect how application works Fixes #7077
This commit is contained in:
parent
c88fae5724
commit
bc04da5e41
@ -23,10 +23,12 @@ function storeConfig(config) {
|
||||
try {
|
||||
writeFileAtomic.sync(serverlessrcPath, JSON.stringify(config, null, 2));
|
||||
} catch (error) {
|
||||
if (process.env.SLS_DEBUG) process.stdout.write(`${chalk.red(error.stack)}\n`);
|
||||
process.stdout.write(
|
||||
`Serverless: ${chalk.red(`Unable to store serverless config due to ${error.code} error`)}\n`
|
||||
);
|
||||
if (process.env.SLS_DEBUG) {
|
||||
process.stdout.write(`${chalk.red(error.stack)}\n`);
|
||||
process.stdout.write(
|
||||
`Serverless: ${chalk.red(`Unable to store serverless config due to ${error.code} error`)}\n`
|
||||
);
|
||||
}
|
||||
try {
|
||||
return JSON.parse(readFileSync(serverlessrcPath));
|
||||
} catch (readError) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user