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

Socket interface answers/errors #272

Open
Lord-Evil opened this issue Oct 5, 2014 · 11 comments
Open

Socket interface answers/errors #272

Lord-Evil opened this issue Oct 5, 2014 · 11 comments

Comments

@Lord-Evil
Copy link

E.g. user in a contact list with no history. We do sock.send("history username") but beeing blocked on reed because telegram-cli says nothing :-) Pleas add "ANSWER 0" as reply to whatever socket command if there's no data to reply.

@aneip
Copy link

aneip commented Oct 7, 2014

I believe when we send msg (command 'msg') also return nothing. Can we have some status whether msg is send or not.

@Lord-Evil
Copy link
Author

aneip, are you making remote client or local wrapper?

@vysheng
Copy link
Owner

vysheng commented Oct 22, 2014

Yep, I'll add some kind of answer.

@luckydonald
Copy link

Can we have replies when the CLI failed (eg. parsing the string)?
Right now we require a timeout to determine that.

@zyberspace
Copy link

Also, some commands return just a new line ("\n") and some the "ANSWER [Bytes]" string.
Why not "ANSWER 7" and then "SUCCESS" in those cases, like for example for "status_online"?

Parsing the answer would be much easier this way. 👍

@luckydonald
Copy link

There should be better (as in more) error messages.
Not only when using sockets, but generally.
For example:
dialjg_list should return/print something like "unknown command"
msg this_user_does_not_exist "test" something like "unknown peer"
msg user something like "missing parameter"
especially when used with sockets, it should always return something.
This issue gains importance with using json (#516) because this makes sockets useful again, and there output is expected.
@zyberspace
Yep. Socket answer parsing would be much easier without need for timeouts. (I didn't encounter linebreaks)

@luckydonald
Copy link

I did a fork/branch thingy gaining in that direction:
bildschirmfoto 2015-05-12 um 16 00 44
but sadly many things/arguments are parsed/validated only in the library, so getting them errors is difficult, and needs insight to the tgl, (and maybe refactoring?)

@luckydonald
Copy link

@Lord-Evil Can you please rename this thread to something more meaningful, like "Socket interface answers/errors"?

@zyberspace
Copy link

@Lord-Evil Can you please rename this thread to something more meaningful, like "Socket interface answers/errors"?

+1 👍

@Lord-Evil Lord-Evil changed the title Socket interface Socket interface answers/errors May 14, 2015
@Lord-Evil
Copy link
Author

@luckydonald done
The most important error message to me seems to be needed for "load_*" commands. Cuz you're never know whether there is no such a file (e.g. wrong msg id) or file size is so big that needs to be awaited for dozens of minutes to download.

@vysheng
Copy link
Owner

vysheng commented May 15, 2015

Added some error codes

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

No branches or pull requests

5 participants