Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential bug: Unexpected Exception for Null Response in Gorse.NET #11

Closed
nebHailemariam opened this issue Oct 24, 2024 · 1 comment · Fixed by #12
Closed

Potential bug: Unexpected Exception for Null Response in Gorse.NET #11

nebHailemariam opened this issue Oct 24, 2024 · 1 comment · Fixed by #12

Comments

@nebHailemariam
Copy link
Collaborator

nebHailemariam commented Oct 24, 2024

Hi @zhenghaoz,

I encountered an issue when using the GetRecommend(string userId) method, which calls "api/recommend/" + userId endpoint in the Gorse.NET library. When the Gorse server returns a null response, the library throws a GorseException with the message "unexpected empty response."

Here’s the relevant code:

throw new GorseException
{
    StatusCode = HttpStatusCode.InternalServerError,
    Message = "unexpected empty response"
}; 

Expected Behavior:

If the Gorse server returns a null response, I believe it would be more appropriate for the library to return null rather than throwing an exception. This change would allow end users to handle null responses more gracefully according to their specific requirements.

Should I open a pull request to fix this problem?

@zhenghaoz
Copy link
Contributor

zhenghaoz commented Oct 24, 2024 via email

@zhenghaoz zhenghaoz linked a pull request Oct 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants