fix baseexception not correctly treated
add some test and ensure it works
modify according to comments
Merge pull request #21 from jsmolina/fix/BaseException_issue20

fix baseexception not correctly treated