If the LLM URL is incorrect and the server responds with a 404 then the SDK produces an apierror.Error with empty Message and Code:
https://github.com/openai/openai-[go/blob/main/internal/requestconfig/requestconfig.go#L512](https://www.golinks.io/blob/main/internal/requestconfig/requestconfig.go#L512?trackSource=github)
When such an error gets serialized downstream, it shows an error object with empty fields, which is not very helpful.
I suggest to handle this more gracefully and populate the Code field with e.g. unknown_url and a message explaining the cause.
Else, how would an application handle this situation? Does it make sense to expose an apierror.Error in the first place?
If the LLM URL is incorrect and the server responds with a
404then the SDK produces anapierror.Errorwith emptyMessageandCode:https://github.com/openai/openai-[go/blob/main/internal/requestconfig/requestconfig.go#L512](https://www.golinks.io/blob/main/internal/requestconfig/requestconfig.go#L512?trackSource=github)
When such an error gets serialized downstream, it shows an error object with empty fields, which is not very helpful.
I suggest to handle this more gracefully and populate the
Codefield with e.g.unknown_urland a message explaining the cause.Else, how would an application handle this situation? Does it make sense to expose an
apierror.Errorin the first place?