When Exception occurs, return also the exception code not only a message.

If we don't return any exception code, or return always 0,  programmer have to parse a exception message. It's not a developer friendly approach.
Merge pull request #1427 from devmach/patch-2

When Exception occurs, return also the exception code not only a message...