Revert "Revert "Setting error handling""

This reverts commit 3c16b2a97632e745bb379287cc59f3a3b2f15fa7.