Catch error conditions in quota.get_mode

Closes #16381
Pylint fix
Merge pull request #16895 from rallytime/bp-16797

Backport #16797 to 2014.7