How to use the @adonisjs/sink.logger.fatal function in @adonisjs/sink

To help you get started, we’ve selected a few @adonisjs/sink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AdonisCommunity / create-adonis-ts-app / index.ts View on Github external
process.env['ADONIS_CREATE_APP_NAME'] = state.name
  process.env['ADONIS_CREATE_ESLINT'] = String(state.eslint)
  process.env['ADONIS_CREATE_APP_CLIENT'] = state.client
  process.env['ADONIS_CREATE_APP_BOILERPLATE'] = state.boilerplate

  /**
   * Setup application
   */
  const application = new Application(absPath, {} as any, {}, {})

  for (let task of tasks) {
    try {
      await task(absPath, application, state)
    } catch (err) {
      logger.error('Unable to create new project. Rolling back')
      logger.fatal(err)
      removeSync(absPath)
      return
    }
  }
}
github AdonisCommunity / create-adonis-ts-app / tasks / createPackageFile.ts View on Github external
if (spinner) {
      spinner.stopAndPersist()
    }
    spinner = ora({ interval: 120 })
    logInstall(list, spinner, dev)
  })

  /**
   * Commit mutations
   */
  const response = await pkg.commitAsync()
  spinner && spinner!.stopAndPersist()

  if (response && response.status === 1) {
    const errorMessage = state.client === 'yarn' ? 'yarn install failed' : 'npm install failed'
    logger.fatal({ message: errorMessage, stack: response.stderr.toString() })
    throw new Error('Installation failed')
  } else {
    logger.create('package.json')
  }
}
github AdonisCommunity / create-adonis-ts-app / tasks / executeInstructions.ts View on Github external
* Print logs and filter out duplicate one's
  */
  logger.resumeLogger((message) => {
    if (LOG_MESSAGES.has(message.message as string) && message.action !== 'fatal') {
      return false
    }

    LOG_MESSAGES.add(message.message as string)
    return true
  })

  /**
   * Handle error
   */
  if (instructionsError) {
    logger.fatal(instructionsError)
    throw instructionsError
  }
}