clean up error messages, and fail gracefully if webapp is invalid