本文整理汇总了TypeScript中fancy-log.error函数的典型用法代码示例。如果您正苦于以下问题:TypeScript error函数的具体用法?TypeScript error怎么用?TypeScript error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了error函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
gulp.task('devServer', async(done) => {
if (devConfig.output == null) {
devConfig.output = {}
}
devConfig.output.path = config.absOutput('')
try {
const server = await serve({
config : devConfig,
host : config.livereloadHost,
// host : '0.0.0.0',
port : config.serverPort,
dev : { publicPath: '', stats: 'minimal' },
content: [],
add : (app, middleware) => {
app.use(c2k(proxy(
config.apiPrefixes,
{
target: `http://localhost:${config.serverPort + 1}`,
secure: false,
},
) as NextHandleFunction))
app.use(c2k(history({
index : `${config.serverIndex}`,
verbose: false,
}) as NextHandleFunction))
middleware.webpack()
// middleware.content()
},
})
server.on('listening', () => {
log('Checking Dev Server status...')
http.get({
host : config.livereloadHost,
port : config.serverPort,
timeout: WAIT_FOR_STARTUP_IN_MS,
}, (res: http.IncomingMessage) => {
log(`Webpack Dev Server started at port ${config.serverPort}`)
res.on('data', _.noop)
res.on('end', done)
})
.on('error', (err?: Error) => {
log.warn('There must be something wrong with webpack dev server:')
log.warn(err)
done()
})
})
} catch (e) {
log.error('Webpack Dev Server startup failed! Detail:')
log.error(e)
}
})
示例2: readdir
readdir(join("dist", "commands"), (error, files) => {
if (error) {
log.error(error);
throw error;
}
files.forEach((file) => {
const cmdFile = require(`./commands/${file}`);
const cmdFileName = file.split(".")[0];
const cmdClass = new cmdFile[cmdFileName]();
app.telegram.command(cmdClass.aliases, cmdClass.execute);
log(`Commandhandler loaded: ${cmdFileName}`);
});
});
示例3: reportError
function reportError(message: string) {
log.error(colors.white.bgRed.bold(message));
process.exit(1);
}