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

[JS] error handling in @eclipse-ditto/ditto-javascript-client-dom #169

Closed
thlandgraf opened this issue Jul 13, 2021 · 3 comments · Fixed by #196
Closed

[JS] error handling in @eclipse-ditto/ditto-javascript-client-dom #169

thlandgraf opened this issue Jul 13, 2021 · 3 comments · Fixed by #196
Labels
bug Something isn't working good first issue Good for newcomers javascript

Comments

@thlandgraf
Copy link

Hi,

when I open a ditto-connection with a wrong PW:

this.restclient = DittoDomClient.newHttpClient()
            .withoutTls()
            .withDomain(domain)
            .withAuthProvider(DomHttpBasicAuth.newInstance("ditto","wrongpw))
            .build();

and call the count method:

this.searchHandle = this.restclient.getSearchHandle();
this.searchHandle.count().then(r => {
     console.log(r);
    },e => {
      console.log(e); // this returns undefined
    })

... HTTP returns properly 401 - since I want to distinguish between HTTP errorcodes, I need to interpret the errorcode. But e is returned as undefined.

What do I miss?

Thomas
@thlandgraf
Copy link
Author

Moved to #169

@thlandgraf thlandgraf reopened this Jul 13, 2021
@thlandgraf
Copy link
Author

reopened... sorry for confusion

@thlandgraf thlandgraf changed the title error handling in @eclipse-ditto/ditto-javascript-client-dom [JS] error handling in @eclipse-ditto/ditto-javascript-client-dom Jul 13, 2021
@thjaeckle
Copy link
Member

Hi @thlandgraf and thanks for reporting.
That most probably is a bug with the JS SDK. The Ditto JS SDK is mainly community-driven and not so frequently used (by the committers of Ditto) as the Java SDK.

We'll look into it ..

@thjaeckle thjaeckle added javascript bug Something isn't working good first issue Good for newcomers labels Jul 14, 2021
thjaeckle added a commit to bosch-io/ditto-clients that referenced this issue Sep 7, 2022
…n in order to access status code together with body

* fixed that only JSON was assumed as body - fall back to any value if error response was not JSON
* updated dependencies to its minor version updates
* update to upcoming Ditto JS client version 3.0.0

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
thjaeckle added a commit that referenced this issue Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers javascript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants