Commit c42ac14
authored
fix(usage): add missing error filtering for users/admin (#257)
Because
- The `TriggerSingleReporter` method was missing the same error
filtering logic that exists in `NewUsage` and `StartReporter` methods
- When `GetUserAdmin` fails with "users/admin" error, it should be
treated as a debug message rather than an error since only Instill Core
CE has the default "admin" user
- Without this filtering, false alarm errors were being logged when the
admin user doesn't exist in other Instill editions
This commit
- Adds the same error filtering pattern to `TriggerSingleReporter` that
already exists in `NewUsage` and `StartReporter`
- Changes the error handling to check if the error contains
"users/admin" and treats it as a debug log instead of an error log
- Ensures consistent error handling across all three methods when
dealing with the default admin user lookup
- Prevents false alarm error logs in Instill editions that don't have
the default admin user1 parent 302d93f commit c42ac14
1 file changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | | - | |
47 | | - | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
| |||
169 | 179 | | |
170 | 180 | | |
171 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
172 | 186 | | |
173 | 187 | | |
174 | 188 | | |
| |||
0 commit comments