Commit 5c32eeb
feat(watcher): surface subscription errors via subscriptionError event
ConfigWatcher now extends EventEmitter and emits a typed
'subscriptionError' event whenever the Subscribe stream encounters an
error. Both retryable errors (UNAVAILABLE, INTERNAL — which trigger
reconnection) and fatal errors (all others — which stop the watcher)
are surfaced, letting callers log or monitor connection health without
polling.
The ConfigWatcherEvents interface is exported for consumers that want
typed listener signatures. The 'subscriptionError' name is intentional:
using 'error' would throw on unhandled listeners per Node.js convention.
Closes #61
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 78cca2e commit 5c32eeb
3 files changed
Lines changed: 103 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
226 | 247 | | |
227 | 248 | | |
228 | 249 | | |
| |||
231 | 252 | | |
232 | 253 | | |
233 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
234 | 259 | | |
235 | 260 | | |
236 | 261 | | |
| |||
239 | 264 | | |
240 | 265 | | |
241 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
242 | 271 | | |
243 | 272 | | |
244 | 273 | | |
| |||
251 | 280 | | |
252 | 281 | | |
253 | 282 | | |
254 | | - | |
| 283 | + | |
255 | 284 | | |
256 | 285 | | |
257 | 286 | | |
| |||
269 | 298 | | |
270 | 299 | | |
271 | 300 | | |
| 301 | + | |
272 | 302 | | |
273 | 303 | | |
274 | 304 | | |
275 | 305 | | |
276 | 306 | | |
277 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
278 | 332 | | |
279 | 333 | | |
280 | 334 | | |
| |||
414 | 468 | | |
415 | 469 | | |
416 | 470 | | |
| 471 | + | |
| 472 | + | |
417 | 473 | | |
418 | 474 | | |
419 | 475 | | |
420 | | - | |
421 | 476 | | |
422 | 477 | | |
423 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
698 | 743 | | |
699 | 744 | | |
700 | 745 | | |
| |||
0 commit comments