use Error instead of Exception

Exception doesn’t exist in javascript.
add tests for DataAdapter
Merge pull request #316 from lusini/fix-DataAdapter

Fix DataAdapter