Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Trouble with catch Error Msg from Server in Android Client #12

Open
Adham32 opened this issue Jul 15, 2019 · 2 comments
Open

Trouble with catch Error Msg from Server in Android Client #12

Adham32 opened this issue Jul 15, 2019 · 2 comments

Comments

@Adham32
Copy link

Adham32 commented Jul 15, 2019

Hi,
we have got a problem. We try to connect to Laravel Echo Server, and all goes well. But the problem is, that our app not receive any Error (if access token is not valid). Laravel Echo server shows in console 401 error (like in screen below). App is still connected and does not receive any event like: "EVENT_ERROR", "EVENT_MESSAGE"..
SERVER LOGS:

image

ANDROID CODE:
Zrzut ekranu 2019-07-15 o 20 02 54

Any idea ? Can you help to us ? :) How to catch AuthenticationException form Laravel Echo Server in Android App.
Kind Regards,
AB.

@jakub-adamski
Copy link

.

@MrBin99
Copy link
Owner

MrBin99 commented Jul 17, 2019

Hello.
I don't know if you can catch this type of exception with the Echo client because it's an application error and not a "network error". My answer (but it may not be relevant for your app) is to not let the end user connect to a channel that you know he cannot access.

You can watch the JavaScript doc of Laravel Echo, my lib is working exactly the same way (I've just translated the JS code into Java).

I think the solution may be to add a callback here but I don't have enough time right now to investigate. Feel free to fork the repo and test it. If you find a solution, please tell me or do a pull request.

Thanks !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants