Catching an exception

I have been building an application using Django and Vuejs. The application using YouTube API to scrap for videos based on a few conditions that are set in the website that I am building. For some conditions I am getting a very weird error which I am not able to catch. What can be done to catch the error?
The error occurs at the place where I am printing Error 1. So many different times of errors occur here and I am not able to catch it, so that I can display customized messages based on the error.

Is keyresearchUrl a Django application URL? If it’s not, then this may not be the best place to get help as that’s a javascript / vendor API issue.

In either case, what are the error messages being logged in the browser’s console and in the server logs?