"use strict";Object.defineProperty(exports, "__esModule", {value: true});




var _chunk3HOVXAQZcjs = require('./chunk-3HOVXAQZ.cjs');



var _chunkSCFUDB74cjs = require('./chunk-SCFUDB74.cjs');

// src/utilities/process-handler.ts
_chunkSCFUDB74cjs.init_cjs_shims.call(void 0, );
var exitWithError = /* @__PURE__ */ _chunkSCFUDB74cjs.__name.call(void 0, (config) => {
  _chunk3HOVXAQZcjs.writeFatal.call(void 0, "Exiting script with an error status...", config);
  process.exit(1);
}, "exitWithError");
var exitWithSuccess = /* @__PURE__ */ _chunkSCFUDB74cjs.__name.call(void 0, (config) => {
  _chunk3HOVXAQZcjs.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
  process.exit(0);
}, "exitWithSuccess");
var handleProcess = /* @__PURE__ */ _chunkSCFUDB74cjs.__name.call(void 0, (config) => {
  _chunk3HOVXAQZcjs.writeTrace.call(void 0, `Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
  process.on("unhandledRejection", (error) => {
    _chunk3HOVXAQZcjs.writeError.call(void 0, `An Unhandled Rejection occurred while running the program: ${error}`, config);
    exitWithError(config);
  });
  process.on("uncaughtException", (error) => {
    _chunk3HOVXAQZcjs.writeError.call(void 0, `An Uncaught Exception occurred while running the program: ${error.message} 
Stacktrace: ${error.stack}`, config);
    exitWithError(config);
  });
  process.on("SIGTERM", (signal) => {
    _chunk3HOVXAQZcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
    exitWithError(config);
  });
  process.on("SIGINT", (signal) => {
    _chunk3HOVXAQZcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
    exitWithError(config);
  });
  process.on("SIGHUP", (signal) => {
    _chunk3HOVXAQZcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
    exitWithError(config);
  });
}, "handleProcess");





exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
