mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-21 07:05:21 +02:00
Improve error handling in license key management: update error logging to provide more informative messages for validation, activation, and deactivation processes.
This commit is contained in:
@@ -19,10 +19,11 @@ export const validateLicenseKey = async (licenseKey: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = await result.json();
|
const data = await result.json();
|
||||||
console.log("data", data);
|
|
||||||
return data.valid;
|
return data.valid;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(
|
||||||
|
error instanceof Error ? error.message : "Failed to validate license key",
|
||||||
|
);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -46,7 +47,9 @@ export const activateLicenseKey = async (licenseKey: string) => {
|
|||||||
const data = await result.json();
|
const data = await result.json();
|
||||||
return data;
|
return data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(
|
||||||
|
error instanceof Error ? error.message : "Failed to activate license key",
|
||||||
|
);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -70,7 +73,11 @@ export const deactivateLicenseKey = async (licenseKey: string) => {
|
|||||||
const data = await result.json();
|
const data = await result.json();
|
||||||
return data;
|
return data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(
|
||||||
|
error instanceof Error
|
||||||
|
? error.message
|
||||||
|
: "Failed to deactivate license key",
|
||||||
|
);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user