Merge pull request #43 from chestnutchen/master

fix #42
fix #44
add ut and rewrite some code
remove ut
Merge branch 'dev' of https://github.com/ecomfe/bat-ria into dev
add handler for fail ERROR message