mirror of
https://github.com/JetSprow/J-Board-Lite.git
synced 2026-05-01 01:14:10 +05:30
fix: include actionable error details
This commit is contained in:
@@ -135,8 +135,8 @@ export async function purchaseProxy(
|
||||
},
|
||||
});
|
||||
|
||||
if (plan.type !== "PROXY") throw new Error("套餐类型错误");
|
||||
if (!plan.isActive) throw new Error("套餐已下架");
|
||||
if (plan.type !== "PROXY") throw new Error(`套餐类型不匹配:${plan.name} 是 ${plan.type},不能作为代理套餐购买`);
|
||||
if (!plan.isActive) throw new Error(`套餐已下架:${plan.name} 当前不可购买`);
|
||||
|
||||
const price = getPlanPurchasePrice(plan, trafficGb);
|
||||
|
||||
@@ -216,8 +216,8 @@ export async function purchaseStreaming(planId: string): Promise<string> {
|
||||
where: { id: planId },
|
||||
});
|
||||
|
||||
if (plan.type !== "STREAMING") throw new Error("套餐类型错误");
|
||||
if (!plan.isActive) throw new Error("套餐已下架");
|
||||
if (plan.type !== "STREAMING") throw new Error(`套餐类型不匹配:${plan.name} 是 ${plan.type},不能作为流媒体套餐购买`);
|
||||
if (!plan.isActive) throw new Error(`套餐已下架:${plan.name} 当前不可购买`);
|
||||
|
||||
const availability = await getPlanAvailability(plan, { userId: session.user.id });
|
||||
if (!availability.available) {
|
||||
|
||||
Reference in New Issue
Block a user