This sounds like you’re running your code inside of a promise, which is throwing an error, but the error is not caught, so you see no error or output from your console.log statement. Although hard to say without seeing the code or a Sandcastle to reproduce.
I would make sure you have the appropriate .catch
or .otherwise
call on your promise to make sure these errors are caught.