Generic Commit; Most likely a fix or small feature

This commit is contained in:
Darius
2025-11-17 23:52:14 +01:00
parent cfb45a03a2
commit d11d6bf5b1
4 changed files with 40 additions and 42 deletions

View File

@@ -1,3 +1,4 @@
import axios from "axios";
import chalk from "chalk";
export function logError(...args: unknown[]) {
@@ -15,3 +16,17 @@ export function logSuccess(...args: unknown[]) {
export function logInfo(...args: unknown[]) {
console.info(chalk.cyan("INFO:"), ...args);
}
export function printNetworkError(error: unknown) {
if (axios.isAxiosError(error)) {
logError("Axios error details:", {
message: error.message,
status: error.response?.status,
statusText: error.response?.statusText,
data: error.response?.data,
url: error.config?.url,
});
} else {
logError("Unexpected error:", error);
}
}