serverless-vpc-discovery icon indicating copy to clipboard operation
serverless-vpc-discovery copied to clipboard

Hard error instead of only a log when there is a error!

Open vinnie1234 opened this issue 3 years ago • 1 comments

When there is an error the log is only a text log and not a hard error. Is it possible to make it a hard error so serverless stop the process?

Globals.ts public static logError (message: any, debug = false): void { const canLog = (debug && process.env.SLS_DEBUG) || !debug; if (canLog) { Globals.cliLog("Error:", message); } }

Types.ts cli: { log (str: string, entity?: string), consoleLog (str: any), };

vinnie1234 avatar Nov 09 '21 11:11 vinnie1234

Yeah this bit me today. Was launching a new environment and due to reasons the vpc discovery plugin could not find the vpc. The tags didn't match (i.e., stage vs staging). All of the serverless resources that had vpc context (such as lambdas) were launched without vpc context instead of just dying. Was mildly surprising and had to do a full sls remove to fix.

ghost avatar Oct 27 '22 16:10 ghost