Commit fd01492
authored
Better error in panic when accessing periodic jobs bundle in client that won't work (#938)
Related to #937. If an insert-only client is created and the
`PeriodicJobs()` bundle is accessed, it'll panic on a nil pointer error.
The error is appropriate because if the client will never work jobs, it
can never be started, which means it can never win leader election,
which means that adding periodic jobs to it will never have any effect,
but the bad error message is definitely not ideal.
Here, detect this condition and panic with an error that better explains
the situation to the caller.
Fixes #937.1 parent f89fc22 commit fd01492
3 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2085 | 2085 | | |
2086 | 2086 | | |
2087 | 2087 | | |
2088 | | - | |
2089 | | - | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
2090 | 2102 | | |
2091 | 2103 | | |
2092 | 2104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4479 | 4479 | | |
4480 | 4480 | | |
4481 | 4481 | | |
| 4482 | + | |
| 4483 | + | |
| 4484 | + | |
| 4485 | + | |
| 4486 | + | |
| 4487 | + | |
| 4488 | + | |
| 4489 | + | |
| 4490 | + | |
| 4491 | + | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
4482 | 4496 | | |
4483 | 4497 | | |
4484 | 4498 | | |
| |||
0 commit comments