7be7d7d1e7
Added test to cover. Started refactoring some of the app error handling in the process of this. Fixes #2696