serverless-plugin-log-subscription.js
// then we can safely assume that this is a pre-existing deployment.
then we can safely assume that this is a pre-existing deployment.
then we can safely assume that this is a pre - existing deployment .
async isDeployed(stackName) {
    const cfnClient = new CloudFormationClient();
    const cmd = new DescribeStacksCommand({ StackName: stackName });
    let res;
    try {
      res = await cfnClient.send(cmd);
    } catch (err) {
      if (err.message.includes('does not exist')) {
        return false; 
      }
      throw err;
    }
    return res?.Stacks.length > 0;
  }
async isDeployed ( stackName ) { const cfnClient = new CloudFormationClient ( ) ; const cmd = new DescribeStacksCommand ( { StackName : stackName } ) ; let res ; try { res = await cfnClient . send ( cmd ) ; } catch ( err ) { if ( err . message . includes ( 'does not exist' ) ) { return false ; } throw err ; } return res ?. Stacks . length > 0 ; }
then we can safely assume that this is a pre-existing deployment.
then we can safely assume that this is a pre - existing deployment .
// If stack doesn't exist it will throw an error, catching it here returning false