Commit 5f743b5
committed
Fix nil pointer dereference in BadRequest error handling
Fixed a bug where the query-resources-count endpoint would panic with
a nil pointer dereference when returning BadRequest errors. The issue
was caused by an inconsistency in the API design where the endpoint
was using dsl.ErrorResult (which generates *goa.ServiceError) instead
of the custom BadRequestError type used by other endpoints.
The generated error handling code tried to cast the error to
*goa.ServiceError, but the service was returning *querysvc.BadRequestError,
causing the cast to fail and leaving the error pointer as nil.
Changes:
- Removed the redundant dsl.Error("BadRequest", dsl.ErrorResult, ...)
declaration from query-resources-count endpoint
- This makes it consistent with other endpoints which use the
service-level BadRequestError type defined at line 22
- Regenerated Goa code to fix the error handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Andres Tobon <[email protected]>1 parent 3990f9e commit 5f743b5
File tree
11 files changed
+42
-168
lines changed- design
- gen
- http
- query_svc
- client
- server
- query_svc
11 files changed
+42
-168
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 139 | + | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
| |||
413 | 415 | | |
414 | 416 | | |
415 | 417 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | 418 | | |
460 | 419 | | |
461 | 420 | | |
| |||
558 | 517 | | |
559 | 518 | | |
560 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
561 | 523 | | |
562 | 524 | | |
563 | 525 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | 146 | | |
150 | 147 | | |
151 | 148 | | |
| |||
229 | 226 | | |
230 | 227 | | |
231 | 228 | | |
232 | | - | |
| 229 | + | |
233 | 230 | | |
234 | 231 | | |
235 | 232 | | |
| |||
245 | 242 | | |
246 | 243 | | |
247 | 244 | | |
248 | | - | |
| 245 | + | |
249 | 246 | | |
250 | 247 | | |
251 | 248 | | |
| |||
395 | 392 | | |
396 | 393 | | |
397 | 394 | | |
398 | | - | |
| 395 | + | |
399 | 396 | | |
400 | 397 | | |
401 | 398 | | |
| |||
411 | 408 | | |
412 | 409 | | |
413 | 410 | | |
414 | | - | |
| 411 | + | |
415 | 412 | | |
416 | 413 | | |
417 | 414 | | |
| |||
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
443 | | - | |
| 440 | + | |
444 | 441 | | |
445 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
446 | 445 | | |
447 | 446 | | |
448 | 447 | | |
| |||
474 | 473 | | |
475 | 474 | | |
476 | 475 | | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | 476 | | |
520 | 477 | | |
521 | 478 | | |
| |||
640 | 597 | | |
641 | 598 | | |
642 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
643 | 606 | | |
644 | 607 | | |
645 | 608 | | |
| |||
661 | 624 | | |
662 | 625 | | |
663 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
664 | 633 | | |
665 | 634 | | |
666 | 635 | | |
| |||
734 | 703 | | |
735 | 704 | | |
736 | 705 | | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | 706 | | |
744 | 707 | | |
745 | 708 | | |
| |||
748 | 711 | | |
749 | 712 | | |
750 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
751 | 717 | | |
752 | 718 | | |
753 | 719 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments