Catch error conditions in quota.get_mode

Closes #16381
lint