K
K
kikibyk2020-01-19 19:12:40
In contact with
kikibyk, 2020-01-19 19:12:40

How can I catch an error from VK?

I need to catch the error that VK gives.
For example, my bot is trying to kick a user who has an administrator and VK gives an error about lack of rights. I need to catch this error and write to the conversation that the bot has insufficient rights.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stockholm Syndrome, 2020-01-19
@StockholmSyndrome

Well, what exactly doesn't work?
if the request is successful, then an object with the response field is returned, if an error, then with error

A
Artyom Vorontsov, 2020-01-19
@ExcLuSiVe0707

An error may be generated, try to catch it using try... catch blocks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question