feat: improve extension engine (#298)

1. support onError event
2. add built-in MessageError
This commit is contained in:
Levi authored and GitHub committed 2023-12-12 19:00:42 +08:00
1 parent ff32971aca
commit 2b5091ba21
16 files changed
+285 -80

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
gopeed.events.onError(async function (ctx) {
gopeed.logger.info("url", ctx.task.meta.req.url);
gopeed.logger.info("error", ctx.error);
ctx.task.meta.req.url = "https://github.com";
ctx.task.pause();
ctx.task.continue();
});