alerts should be user friendly messages shown to the user. console.logs don't have to be nice because users dont use logs. Have you tried to make this fail so you can see what reason comes out to be? It might be a weird message that the user doesn't care about. Something like console.log(reason); alert("Creating new topic has failed. Please try again"); or something seems to make more sense.