Pass errors to callbacks instead of throwing them

To make the behaviour consistent across the library, errors should be passed to callbacks instead of throwing them.