amplify-education / serverless-vpc-discovery

Serverless plugin for discovering VPC / Subnet / Security Group configuration by name.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

vinnie1234 opened this issue · 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), };

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.