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

Can't get the error description from telegram. #18

Open
qinjian623 opened this issue Jan 7, 2016 · 3 comments
Open

Can't get the error description from telegram. #18

qinjian623 opened this issue Jan 7, 2016 · 3 comments

Comments

@qinjian623
Copy link
Contributor

Install this lib from gem.

I found that if the response is not OK, the description of error will not be stored in the ApiResponse.
This makes debug a little harder, and can't send the error message back to user.

Do you plan to add the error description into the ApiResponse?
Or I can send a pull request to fix this if you thought it is necessary.

@eljojo
Copy link
Owner

eljojo commented Jan 7, 2016

Hi Qin,
This is a great idea!
Please open a PR :)

Typed on tiny keys, just for you.

On 07 Jan 2016, at 09:05, Qin Jian [email protected] wrote:

Install this lib from gem

I found that if the response is not OK, the description of error will not be stored in the ApiResponse
This makes debug a little harder, and can't send the error message back to user

Do you plan to add the error description into the ApiResponse?
Or I can send a pull request to fix this if you thought it is necessary


Reply to this email directly or view it on GitHub.

@qinjian623
Copy link
Contributor Author

Hi,
Adding error description info into ApiResponse is easy. But I don't know how to throw the error info out into high level.

The ApiResponse will be transformed into Message. But Message doesn't have any field can store error info.

I don't know whether to add fields into Message to store error info or throw an exception.

Currently if the response is not OK, Message's fields will be nil. So users can't get the details of error info in response.

If add fields of error info into Message, users must check whether Message is OK every time. If users don't check, the behavior of code may not change(just like now).

Or,
handling the exception or not, chosen by themselves, but if not, may interrupt the program.

And in fact, error response rarely happens.

@qinjian623
Copy link
Contributor Author

#20 This is the PR.
Only the code of saving the error info in ApiResponse without any error handling.

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

2 participants