Revert "Revert "Revert "Error handling"""

This reverts commit 684cf6742b2fd94c5256bd514cac45908c9828cf.