-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FSM 内部执行外部函数出现异常时不应崩溃 #616
Conversation
✅ Deploy Preview for nonebot-bison ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for nonebot-bison ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #616 +/- ##
==========================================
+ Coverage 85.45% 85.64% +0.19%
==========================================
Files 91 91
Lines 4793 4822 +29
==========================================
+ Hits 4096 4130 +34
+ Misses 697 692 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2d3186e
to
d2ed7b7
Compare
是不是应该在每个 action 里处理错误处理,在外层如果检测到发生错误就直接 reset |
reset与否我认为应该让具体的使用场景抉择,而不是包办 |
这样,默认的行为是 exception 之后 fsm 报错。然后外面包一个 wrapper?如果发生错误就创建新的 fsm |
7608082
to
2d54625
Compare
def __init__(self, graph: StateGraph[TState, TEvent, TAddon], addon: TAddon): ... | ||
|
||
@overload | ||
def __init__(self, graph: StateGraph[TState, TEvent, TAddon], addon: TAddon, *, transfer_anyway: bool = ...): | ||
"""if, transfer_anyway` is True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是不 overload 也可以
避免因网络不佳等原因使 action 抛出异常导致 FSM 异常终止