refactor: Pass errors to callback function instead of throwing

Closes #1