opticore-catch-exception-error 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -208,26 +208,25 @@ var import_opticore_translator2 = require("opticore-translator");
208
208
  var dateTimeFormatted = `${(/* @__PURE__ */ new Date()).getMonth()}-${(/* @__PURE__ */ new Date()).getDate()}-${(/* @__PURE__ */ new Date()).getFullYear()} ${(/* @__PURE__ */ new Date()).getHours()}:${(/* @__PURE__ */ new Date()).getMinutes()}:${(/* @__PURE__ */ new Date()).getSeconds()}`;
209
209
 
210
210
  // src/core/errors/events/serverListen.event.error.ts
211
- var import_opticore_env_access2 = require("opticore-env-access");
211
+ var import_opticore_env_access = require("opticore-env-access");
212
212
 
213
213
  // src/core/config/loaders/translateLanguage.loader.ts
214
214
  var import_path = __toESM(require("path"), 1);
215
215
  var import_module = require("module");
216
216
  var import_opticore_translator = require("opticore-translator");
217
- var import_opticore_env_access = require("opticore-env-access");
218
- var translateCatchExceptionErrorLanguageLoader = () => {
217
+ var translateCatchExceptionErrorLanguageLoader = (defaultLocalLang) => {
219
218
  const require2 = (0, import_module.createRequire)(importMetaUrl);
220
219
  const packagePath = import_path.default.dirname(require2.resolve("opticore-catch-exception-error"));
221
220
  const translateMsgJsonFilePath = import_path.default.join(packagePath, "utils", "translations");
222
- import_opticore_translator.TranslationLoader.loadTranslations(translateMsgJsonFilePath, import_opticore_env_access.getEnvVariable.defaultLocal);
221
+ import_opticore_translator.TranslationLoader.loadTranslations(translateMsgJsonFilePath, defaultLocalLang);
223
222
  };
224
223
 
225
224
  // src/core/errors/events/serverListen.event.error.ts
226
225
  var ServerListenEventError = class {
227
226
  static logger = new import_opticore_logger.LoggerCore();
228
227
  static stackTrace;
229
- static __init() {
230
- translateCatchExceptionErrorLanguageLoader();
228
+ static __init(defaultLocalLang) {
229
+ translateCatchExceptionErrorLanguageLoader(defaultLocalLang);
231
230
  return this;
232
231
  }
233
232
  /**
@@ -242,7 +241,7 @@ var ServerListenEventError = class {
242
241
  this.logger.error(
243
242
  this.stackTrace.message,
244
243
  import_opticore_translator2.TranslationLoader.t("webServer", import_opticore_translator2.CLocal),
245
- import_opticore_translator2.TranslationLoader.t("badPort", import_opticore_translator2.CLocal, { badPort: import_opticore_env_access2.getEnvVariable.appPort }),
244
+ import_opticore_translator2.TranslationLoader.t("badPort", import_opticore_translator2.CLocal, { badPort: import_opticore_env_access.getEnvVariable.appPort }),
246
245
  this.stackTrace.stack,
247
246
  import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
248
247
  );
@@ -253,7 +252,7 @@ var ServerListenEventError = class {
253
252
  */
254
253
  static hostUndefined() {
255
254
  this.stackTrace = this.traceError(
256
- import_opticore_translator2.TranslationLoader.t("badHost", import_opticore_translator2.CLocal, { badHost: import_opticore_env_access2.getEnvVariable.appHost }),
255
+ import_opticore_translator2.TranslationLoader.t("badHost", import_opticore_translator2.CLocal, { badHost: import_opticore_env_access.getEnvVariable.appHost }),
257
256
  import_opticore_translator2.TranslationLoader.t("listening", import_opticore_translator2.CLocal),
258
257
  import_opticore_http_response11.HttpStatusCode.BAD_REQUEST
259
258
  );
package/dist/index.d.cts CHANGED
@@ -130,7 +130,7 @@ declare class StackTraceURIError extends StackTraceError {
130
130
  declare class ServerListenEventError {
131
131
  private static logger;
132
132
  private static stackTrace;
133
- static __init(): typeof ServerListenEventError;
133
+ static __init(defaultLocalLang: string): typeof ServerListenEventError;
134
134
  /**
135
135
  *
136
136
  */
package/dist/index.d.ts CHANGED
@@ -130,7 +130,7 @@ declare class StackTraceURIError extends StackTraceError {
130
130
  declare class ServerListenEventError {
131
131
  private static logger;
132
132
  private static stackTrace;
133
- static __init(): typeof ServerListenEventError;
133
+ static __init(defaultLocalLang: string): typeof ServerListenEventError;
134
134
  /**
135
135
  *
136
136
  */
package/dist/index.js CHANGED
@@ -154,26 +154,25 @@ import { CLocal, TranslationLoader as TranslationLoader2 } from "opticore-transl
154
154
  var dateTimeFormatted = `${(/* @__PURE__ */ new Date()).getMonth()}-${(/* @__PURE__ */ new Date()).getDate()}-${(/* @__PURE__ */ new Date()).getFullYear()} ${(/* @__PURE__ */ new Date()).getHours()}:${(/* @__PURE__ */ new Date()).getMinutes()}:${(/* @__PURE__ */ new Date()).getSeconds()}`;
155
155
 
156
156
  // src/core/errors/events/serverListen.event.error.ts
157
- import { getEnvVariable as getEnvVariable2 } from "opticore-env-access";
157
+ import { getEnvVariable } from "opticore-env-access";
158
158
 
159
159
  // src/core/config/loaders/translateLanguage.loader.ts
160
160
  import path from "path";
161
161
  import { createRequire } from "module";
162
162
  import { TranslationLoader } from "opticore-translator";
163
- import { getEnvVariable } from "opticore-env-access";
164
- var translateCatchExceptionErrorLanguageLoader = () => {
163
+ var translateCatchExceptionErrorLanguageLoader = (defaultLocalLang) => {
165
164
  const require2 = createRequire(import.meta.url);
166
165
  const packagePath = path.dirname(require2.resolve("opticore-catch-exception-error"));
167
166
  const translateMsgJsonFilePath = path.join(packagePath, "utils", "translations");
168
- TranslationLoader.loadTranslations(translateMsgJsonFilePath, getEnvVariable.defaultLocal);
167
+ TranslationLoader.loadTranslations(translateMsgJsonFilePath, defaultLocalLang);
169
168
  };
170
169
 
171
170
  // src/core/errors/events/serverListen.event.error.ts
172
171
  var ServerListenEventError = class {
173
172
  static logger = new LoggerCore();
174
173
  static stackTrace;
175
- static __init() {
176
- translateCatchExceptionErrorLanguageLoader();
174
+ static __init(defaultLocalLang) {
175
+ translateCatchExceptionErrorLanguageLoader(defaultLocalLang);
177
176
  return this;
178
177
  }
179
178
  /**
@@ -188,7 +187,7 @@ var ServerListenEventError = class {
188
187
  this.logger.error(
189
188
  this.stackTrace.message,
190
189
  TranslationLoader2.t("webServer", CLocal),
191
- TranslationLoader2.t("badPort", CLocal, { badPort: getEnvVariable2.appPort }),
190
+ TranslationLoader2.t("badPort", CLocal, { badPort: getEnvVariable.appPort }),
192
191
  this.stackTrace.stack,
193
192
  status11.BAD_REQUEST
194
193
  );
@@ -199,7 +198,7 @@ var ServerListenEventError = class {
199
198
  */
200
199
  static hostUndefined() {
201
200
  this.stackTrace = this.traceError(
202
- TranslationLoader2.t("badHost", CLocal, { badHost: getEnvVariable2.appHost }),
201
+ TranslationLoader2.t("badHost", CLocal, { badHost: getEnvVariable.appHost }),
203
202
  TranslationLoader2.t("listening", CLocal),
204
203
  status11.BAD_REQUEST
205
204
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opticore-catch-exception-error",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "opticore catch exception error",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",