Revert "Add exceptions instead of returning an error in the callback"

This reverts commit 0bf99fda394120dc7d13c43770a598a91ed3e6b8.