Add exceptions and error callback