zerobias / telegram-mtproto

Telegram client api (MTProto) library
MIT License
620 stars 136 forks source link

Endless promises #103

Closed Alavi1412 closed 5 years ago

Alavi1412 commented 7 years ago

when I use a method and I do something wrong(or internet go disconnected), my code completely stop working and wait forever because the source code of the methods doesn't handle the promises at error and this cause some kind of crash in my app. and I can't handle the error in my code, for example when I enter the wrong phone number, it said INVALID_PHONE_NUMBER and my app wait forever because the method didn't return promise, please handle that

goodmind commented 7 years ago

@Alavi1412 but it returns promises

Alavi1412 commented 7 years ago

@goodmind So why it wait forever?

zerobias commented 7 years ago

@Alavi1412

because the method didn't return promise

Interesting, which version do you use?

Alavi1412 commented 7 years ago

I have tested all versions, I can't handle the errors in my codes, latest version I have testes I think was 3.2.11

wfjsw commented 7 years ago

In my case the error is caught but it retry the failed request itself in an infinite loop.

agogex commented 7 years ago

I think this is the same #111 problem. Can't get an error in the catch section, for any way, promise or async/await. Please help to resolve this issue.

febrihardians commented 6 years ago

i can not catch exception too and in the console i have warning "a promise was rejected with a non-error"

kesor commented 6 years ago

The exceptions AUTH_KEY_UNREGISTERED and AUTH_RESTART are silently removed and not thrown. I assume that single-handler.js is trying to load the auth keys from storage. But it should really throw the error if it doesn't work since it might be that the user has never signed-in yet and no auth id exists.

alimhv commented 6 years ago

Me too cant catch errors , i set debug bool to true then false in app config , but not working help us

const app = {
  debug:true,
    storage: new Storage('./storage.json')
}

@zerobias @wfjsw

Baael commented 6 years ago

Debug isn't working for me either. However everytime it hangs silently in await, I have to remove storage.json and sign in again. So I guess it has something with storage and file system. telegram-mtproto@alpha

callmez commented 6 years ago

same problem to me , any news for this?

nagashik commented 6 years ago

looks like the same truble for me #171

nagashik commented 6 years ago

did someone solve this problem?

amarcus commented 6 years ago

Relax guys this project is dead, face it. Latest stable version is 3.2.7 use it. Zerobias doesn't give a shit about his project is totally not working. No docs, no wiki, garbage code, not working examples, a freaking mess.