error handling

- added unified error handling as a light weight wrapper around native
error
- more robust logging interface