widget code re-factoring.
error handling and error object population
Merge pull request #40 from pkiran/master

Error Handling