本文整理汇总了TypeScript中bluebird.longStackTraces函数的典型用法代码示例。如果您正苦于以下问题:TypeScript longStackTraces函数的具体用法?TypeScript longStackTraces怎么用?TypeScript longStackTraces使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了longStackTraces函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
var setGlobals = function () {
var Promise = require('bluebird');
Promise.longStackTraces();
global.Promise = Promise;
var Mapstrace = require('mapstrace');
Promise.promisifyAll(Mapstrace);
global.PrettyError = function (err, msg, cb) {
return Mapstrace.build(err, true, function (result) {
sails.log.error(msg);
sails.log.error(err.toString() + ':\n' + Mapstrace.stringify(result));
if (cb) cb();
})
};
process.on("unhandledRejection", function (error, promise) {
PrettyError(error, '[Bluebird]Unhandled rejection:', function () {
sails.log.error('From promise:', promise)
});
});
process.on("uncaughtException", function (error) {
PrettyError(error, 'An uncaught exception has caused Node.js to crash!', function () {
process.exit(1);
});
});
if (sails.config.environment === 'production') {
sails.hooks.http.app.locals.assetPrefix = '/assets'
} else {
sails.hooks.http.app.locals.assetPrefix = '/assets'
}
};
示例2: require
// Main control plane.
var Promise = require("bluebird");
Promise.longStackTraces();
var KubernetesClient = require("./kubernetes-rest.js");
var chalk = require("chalk");
var cmdln = require("cmdln");
var util = require("util");
var logger = require("./logger");
var Project = require("./project");
var Resource = require("./resource");
var Diafile = require("./diafile");
var Errors = require("./errors");
var DiatropikonError = Errors.DiatropikonError;
var KubernetesError = Errors.KubernetesError;
// import Operation = require("./operation");
logger.debug("Starting Diatropikon...")
export class Diatropikon {
operations: Operation[]
示例3:
import * as chai from "chai";
import * as chaiAsPromised from "chai-as-promised";
import * as Bluebird from "bluebird";
import * as sourceMapSupport from "source-map-support";
Bluebird.longStackTraces();
sourceMapSupport.install({
handleUncaughtExceptions: false
});
chai.use(chaiAsPromised);