Answer the question
In order to leave comments, you need to log in
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
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
An error may be generated, try to catch it using try... catch blocks
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question