namirasoft-core
Advanced tools
Comparing version 1.3.29 to 1.3.30
@@ -20,2 +20,3 @@ "use strict"; | ||
const ErrorOperation_1 = require("./ErrorOperation"); | ||
const ConsoleOperation_1 = require("./ConsoleOperation"); | ||
class BaseServer { | ||
@@ -45,3 +46,8 @@ constructor(domain) { | ||
if (error instanceof Error) { | ||
this.onError(error); | ||
if (this.onError) | ||
this.onError(error); | ||
else { | ||
ConsoleOperation_1.ConsoleOperation.warning("onError function has not been properly set."); | ||
ConsoleOperation_1.ConsoleOperation.error(error === null || error === void 0 ? void 0 : error.message); | ||
} | ||
if (axios_1.default.isAxiosError(error)) | ||
@@ -48,0 +54,0 @@ if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) |
@@ -11,3 +11,3 @@ { | ||
"private": false, | ||
"version": "1.3.29", | ||
"version": "1.3.30", | ||
"author": "Amir Abolhasani", | ||
@@ -22,3 +22,3 @@ "license": "MIT", | ||
"@types/node": "^20.12.12", | ||
"axios": "^1.6.8", | ||
"axios": "^1.7.1", | ||
"moment": "^2.30.1", | ||
@@ -25,0 +25,0 @@ "phone": "^3.1.43" |
@@ -6,2 +6,3 @@ import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; | ||
import { ParsedNameValue } from "./ParsedNameValue"; | ||
import { ConsoleOperation } from "./ConsoleOperation"; | ||
@@ -38,3 +39,9 @@ export abstract class BaseServer | ||
{ | ||
this.onError(error); | ||
if (this.onError) | ||
this.onError(error); | ||
else | ||
{ | ||
ConsoleOperation.warning("onError function has not been properly set."); | ||
ConsoleOperation.error(error?.message); | ||
} | ||
if (axios.isAxiosError(error)) | ||
@@ -41,0 +48,0 @@ if (error?.response?.data) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
343367
4257
Updatedaxios@^1.7.1