Improve errors handling in sendMsg when called from browser's scope

Resolves #230 - kind of ;)