Glitch error message line

Hi! Somewhat new to glitch…
When there’s something wrong with the code while its being run, glitch will give me a helpful error message such as

(node:12995) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property ‘send’ of undefined

The problem is, the ‘send’ function could appear in my code 10 to a hundred times. Is there any way to check what line the error is from?

Thanks!

You can use the debugger to step through your code and work out at which call the error is happening. Or add additional logging before each function call so you can see after which one the issue occurs.