Commit 057104b
committed
refactor: use typed AskIgnoredError with instanceof check
- Create AskIgnoredError class for the ask-ignored control flow signal
- Throw AskIgnoredError instead of generic Error in Task.ask()
- Use instanceof AskIgnoredError for type-safe detection in handleError()
This is more robust than string matching because instanceof is type-safe
and won't accidentally match unrelated errors.1 parent c12970a commit 057104b
File tree
3 files changed
+25
-7
lines changed- src/core
- assistant-message
- task
3 files changed
+25
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
227 | | - | |
| 228 | + | |
228 | 229 | | |
229 | | - | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
618 | | - | |
| 619 | + | |
619 | 620 | | |
620 | | - | |
| 621 | + | |
621 | 622 | | |
622 | 623 | | |
623 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
983 | 985 | | |
984 | 986 | | |
985 | 987 | | |
986 | | - | |
| 988 | + | |
987 | 989 | | |
988 | 990 | | |
989 | 991 | | |
| |||
992 | 994 | | |
993 | 995 | | |
994 | 996 | | |
995 | | - | |
| 997 | + | |
996 | 998 | | |
997 | 999 | | |
998 | 1000 | | |
| |||
1146 | 1148 | | |
1147 | 1149 | | |
1148 | 1150 | | |
1149 | | - | |
| 1151 | + | |
1150 | 1152 | | |
1151 | 1153 | | |
1152 | 1154 | | |
| |||
0 commit comments