Improved webapp error handling