Revert "Error handling optimizations"

This reverts commit 66da5a62369493a1eca8d1a9ce9f13c72fea9acd.
Revert "Revert "Error handling optimizations""

This reverts commit e1d86a3239f26b39d4184c8eba0a969b921b7b14.
Revert "Error handling optimizations"

This reverts commit 66da5a62369493a1eca8d1a9ce9f13c72fea9acd.