rust-server-sdk icon indicating copy to clipboard operation
rust-server-sdk copied to clipboard

Expose cause of initialization errors

Open ramosbugs opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe.

The Client provides an initialized_async method to wait until it has completed initialization. The function returns false if an error occurs, but there doesn't seem to be a way to access the error for logging purposes. This could make it a challenge to debug initialization issues.

Describe the solution you'd like

A more idiomatic interface in Rust would be to have initialized_async return something like Result<(), InitError> and define an InitError type to describe the different failure conditions that might arise.

Describe alternatives you've considered

A separate method could be used to retrieve the error (e.g., returning Option<InitError>.

ramosbugs avatar Feb 15 '22 12:02 ramosbugs

Thank you for the feedback! I have filed this request internally as sc-142483.

keelerm84 avatar Feb 16 '22 22:02 keelerm84

:+1: for this.

aalexandrov avatar Dec 13 '22 11:12 aalexandrov

+1 for this, I am having an unknown issue which for some reason client is not initializing.

gabriel-lima avatar Jun 14 '23 13:06 gabriel-lima

Experiencing the same issue, we had to spend quite a bit of time debugging and only found an issue once enabled TRACE logs. Would be great to have an explicit error returned when SDK key is wrong, or any other error happened (like timeout, etc).

saks avatar Jun 15 '23 21:06 saks