From 9a44b3a0cc8bf7196e4d9e06cd53ae2be57f0171 Mon Sep 17 00:00:00 2001 From: HF Date: Wed, 12 Oct 2022 14:27:56 +0200 Subject: [PATCH] throw correct return code when proxy checking while placing --- src/core/draw.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/core/draw.js b/src/core/draw.js index dc5dbe56..9e1e1e7b 100644 --- a/src/core/draw.js +++ b/src/core/draw.js @@ -185,7 +185,20 @@ export default async function drawByOffsets( if (needProxycheck) { const pc = await isIPAllowed(ip, true); if (pc.status > 0) { - throw new Error(11); + pxlCnt = 0; + switch (pc.status) { + case 1: + // proxy + throw new Error(11); + case 2: + // banned + throw new Error(14); + case 3: + // range banned + throw new Error(15); + default: + // nothing + } } }