Skip to content

bug: 当 PR 对应的 Issue 不存在时会报错 #474

@he0119

Description

@he0119

https://github.com/nonebot/nonebot2/actions/runs/23191121358/job/67387193264?pr=3887#step:5:125

03-17 19:05:16 [INFO] github:publish | 正在处理 Plugin: CS2 Bridge
03-17 19:05:16 [INFO] nonebot | Matcher(type='', module=src.plugins.github.plugins.resolve, lineno=57) running complete
03-17 19:05:16 [ERROR] nonebot | Running Matcher(type='', module=src.plugins.github.plugins.resolve, lineno=57) failed.
Traceback (most recent call last):
  File "/app/bot.py", line 100, in <module>
    nonebot.run()
  File "/app/.venv/lib/python3.13/site-packages/nonebot/__init__.py", line 337, in run
    get_driver().run(*args, **kwargs)
  File "/app/.venv/lib/python3.13/site-packages/nonebot/drivers/none.py", line 61, in run
    anyio.run(self._serve)
  File "/app/.venv/lib/python3.13/site-packages/anyio/_core/_eventloop.py", line 74, in run
    return async_backend.run(func, args, {}, backend_options)
  File "/app/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 2284, in run
    return runner.run(wrapper())
  File "/usr/local/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 712, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 683, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2042, in _run_once
    handle._run()
  File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
  File "/app/.venv/lib/python3.13/site-packages/nonebot/utils.py", line 254, in run_coro_with_shield
    return await coro
  File "/app/.venv/lib/python3.13/site-packages/nonebot/message.py", line 506, in check_and_run_matcher
    await _run_matcher(
> File "/app/.venv/lib/python3.13/site-packages/nonebot/message.py", line 458, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/app/.venv/lib/python3.13/site-packages/nonebot/internal/matcher/matcher.py", line 926, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/app/.venv/lib/python3.13/site-packages/nonebot/internal/matcher/matcher.py", line 863, in simple_run
    await handler(
  File "/app/.venv/lib/python3.13/site-packages/nonebot/dependencies/__init__.py", line 113, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/app/src/plugins/github/plugins/resolve/__init__.py", line 86, in handle_pr_close
    await resolve_conflict_pull_requests(handler, pull_requests)
  File "/app/src/plugins/github/plugins/resolve/__init__.py", line 39, in resolve_conflict_pull_requests
    await resolve_conflict_publish_pull_requests(handler, [pull_request])
  File "/app/src/plugins/github/plugins/publish/utils.py", line 135, in resolve_conflict_pull_requests
    issue_handler = await handler.to_issue_handler(issue_number)
  File "/app/src/plugins/github/handlers/github.py", line 29, in to_issue_handler
    issue = await self.get_issue(issue_number)
  File "/app/src/plugins/github/handlers/github.py", line 259, in get_issue
    await self.bot.rest.issues.async_get(
  File "/app/.venv/lib/python3.13/site-packages/nonebot/adapters/github/utils.py", line 33, in __call__
    return await self.bot.call_api(".".join(self.parts), **kwargs)
  File "/app/.venv/lib/python3.13/site-packages/nonebot/internal/adapter/bot.py", line 176, in call_api
    raise exception
  File "/app/.venv/lib/python3.13/site-packages/nonebot/internal/adapter/bot.py", line 128, in call_api
    result = await self.adapter._call_api(self, api, **data)
  File "/app/.venv/lib/python3.13/site-packages/nonebot/adapters/github/adapter.py", line 122, in _call_api
    raise ActionFailed(e.response) from None
nonebot.adapters.github.exception.ActionFailed: ActionFailed(method=GET, url=https://api.github.com/repos/nonebot/nonebot2/issues/3890, status_code=404 Not Found)
03-17 19:05:16 [INFO] nonebot | Shutting down
03-17 19:05:16 [INFO] nonebot | Waiting for application shutdown. (CTRL+C to force quit)
03-17 19:05:16 [INFO] nonebot | Application shutdown complete.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions