[minor] Better error handling when not in UI mode.