Skip to content

ifix(go): RequestBuilder의 JSON 마샬링 에러가 무시되는 문제 수정#255

Merged
kubrickcode merged 1 commit intomainfrom
develop/shlee/254
Nov 27, 2025
Merged

ifix(go): RequestBuilder의 JSON 마샬링 에러가 무시되는 문제 수정#255
kubrickcode merged 1 commit intomainfrom
develop/shlee/254

Conversation

@kubrickcode
Copy link
Owner

JSON() 메서드에서 발생한 마샬링 에러가 errors 필드에 저장되지만 Build() 메서드에서 체크하지 않아 에러가 무시됨

  • Build()에 누적 에러 체크 로직 추가
  • 모든 체이닝 메서드에 early return 패턴 적용
  • 테스트 7개 케이스 추가

fix #254

@gemini-code-assist
Copy link

Summary of Changes

Hello @kubrickcode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 Go HTTP 클라이언트의 RequestBuilder에서 JSON 마샬링 에러가 제대로 처리되지 않아 요청 빌드 과정에서 에러가 묵인될 수 있었던 문제를 해결합니다. 이제 빌더의 체이닝 과정에서 에러가 발생하면 즉시 전파되어 Build() 메서드에서 명확하게 에러를 반환함으로써, 개발자가 잠재적인 문제를 조기에 인지하고 대응할 수 있도록 견고성을 강화했습니다.

Highlights

  • JSON 마샬링 에러 처리 개선: RequestBuilder의 JSON() 메서드에서 발생하는 마샬링 에러가 더 이상 무시되지 않고, Build() 메서드에서 명확하게 반환되도록 수정되었습니다.
  • 체이닝 메서드 에러 전파: Method(), Path(), AddHeader(), AddQueryParam(), JSON() 등 모든 체이닝 메서드에 early return 패턴이 적용되어, 이전 단계에서 에러가 발생하면 이후 체이닝 호출이 무의미하게 진행되지 않도록 개선되었습니다.
  • 누적 에러 체크 로직 추가: Build() 메서드에 errors 필드에 누적된 에러를 체크하는 로직이 추가되어, 빌드 과정에서 발생한 모든 에러를 최종적으로 검사하고 반환합니다.
  • 새로운 테스트 케이스 추가: 새로운 에러 처리 로직의 유효성을 검증하기 위해 7개의 테스트 케이스가 request-builder_test.go 파일에 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions bot added the refactor Refactoring code label Nov 27, 2025
@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 RequestBuilder에서 JSON 마샬링 에러가 무시되던 버그를 성공적으로 수정했습니다. 모든 체이닝 메서드에 early return 패턴을 적용하고 Build() 메서드에서 누적된 에러를 확인하는 방식은 올바른 접근입니다. 또한, 다양한 시나리오를 커버하는 테스트 케이스를 추가하여 코드의 안정성을 크게 높인 점이 좋습니다. 다만, 추가된 테스트 코드의 품질과 유지보수성을 높이기 위한 몇 가지 개선 사항을 제안합니다.

JSON() 메서드에서 발생한 마샬링 에러가 errors 필드에 저장되지만 Build() 메서드에서 체크하지 않아 에러가 무시됨

- Build()에 누적 에러 체크 로직 추가
- 모든 체이닝 메서드에 early return 패턴 적용
- 테스트 7개 케이스 추가

fix #254
@kubrickcode kubrickcode merged commit 5744d57 into main Nov 27, 2025
6 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/254 branch November 27, 2025 10:44
@kubrickcode
Copy link
Owner Author

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RequestBuilder 에러 처리 수정

1 participant