Commit 2af9a07
committed
feat: refactor error handling and improve logging in Run function
This pull request changes:
- Eliminates unnecessary error messages when specific operations cannot be performed (e.g., when verbs do not include "watch").
- Updates error logging to provide more context by using the `%w` verb for wrapping errors, allowing better error tracking.
- Enhances concurrency handling in the port-forwarding logic by explicitly passing `containerPort` and `hostPort` to the goroutine, reducing reliance on closures that capture variables.
```mermaid
sequenceDiagram
participant User
participant Server
User->>Server: Request operation
alt Success
Server-->>User: Successfully executed operation
else Error Occurred
Server-->>User: Error message with context
end
```1 parent f21a7c7 commit 2af9a07
1 file changed
+8
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | | - | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | 203 | | |
206 | 204 | | |
207 | 205 | | |
| |||
212 | 210 | | |
213 | 211 | | |
214 | 212 | | |
215 | | - | |
| 213 | + | |
216 | 214 | | |
217 | 215 | | |
218 | 216 | | |
219 | 217 | | |
220 | | - | |
| 218 | + | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
229 | | - | |
| 227 | + | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
| |||
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
241 | | - | |
242 | 238 | | |
243 | 239 | | |
244 | 240 | | |
| |||
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
| |||
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
294 | | - | |
| 293 | + | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
| |||
0 commit comments