mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-12 06:39:04 +08:00
feat: 处理状态码
This commit is contained in:
parent
d015c7867e
commit
9a3cd4f57c
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.438",
|
||||
"version": "2.14.439",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -172,7 +172,7 @@ export default async function download(
|
||||
`Downloading...\nUser-Agent: ${userAgent}\nTimeout: ${requestTimeout}\nProxy: ${proxy}\nInsecure: ${!!insecure}\nURL: ${url}`,
|
||||
);
|
||||
try {
|
||||
const { body, headers } = await http.get({
|
||||
const { body, headers, statusCode } = await http.get({
|
||||
url,
|
||||
...(proxy ? { proxy } : {}),
|
||||
...(isLoon && proxy ? { node: proxy } : {}),
|
||||
@ -180,6 +180,10 @@ export default async function download(
|
||||
...(proxy ? getPolicyDescriptor(proxy) : {}),
|
||||
...(insecure ? insecure : {}),
|
||||
});
|
||||
$.info(`statusCode: ${statusCode}`);
|
||||
if (statusCode < 200 || statusCode >= 400) {
|
||||
throw new Error(`statusCode: ${statusCode}`);
|
||||
}
|
||||
|
||||
if (headers) {
|
||||
const flowInfo = getFlowField(headers);
|
||||
|
Loading…
x
Reference in New Issue
Block a user