Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";let logger;logger=require("../logger").getLogger("util/uncaughtExceptionHandler",newLogger=>{logger=newLogger});const unhandledRejectionEventName="unhandledRejection";let unhandledRejectionDeprecationWarningHasBeenEmitted=!1,config,unhandledRejectionsMode="warn/default";for(let i=0;i<process.execArgv.length;i++)"--unhandled-rejections=none"===process.execArgv[i]?unhandledRejectionsMode="none":"--unhandled-rejections=strict"===process.execArgv[i]&&(unhandledRejectionsMode="strict");function activateUnhandledPromiseRejectionHandling(){config.reportUnhandledPromiseRejections?"strict"===unhandledRejectionsMode?logger.warn("Node.js has been started with --unhandled-rejections=strict, therefore reporting unhandled promise rejections will not be enabled."):(process.on(unhandledRejectionEventName,onUnhandledRejection),logger.info("Reporting unhandled promise rejections is enabled.")):logger.info("Reporting unhandled promise rejections is disabled.")}function onUnhandledRejection(reason){"none"!==unhandledRejectionsMode&&(console.warn("UnhandledPromiseRejectionWarning:",reason),console.warn("UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch()."),unhandledRejectionDeprecationWarningHasBeenEmitted||(console.warn("[DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code."),unhandledRejectionDeprecationWarningHasBeenEmitted=!0))}exports.init=function(_config){config=_config},exports.activate=function(){activateUnhandledPromiseRejectionHandling()},exports.deactivate=function(){process.removeListener(unhandledRejectionEventName,onUnhandledRejection)};