Added onError method

The method sets callback which invokes every time when an exception raised with passing error description