@nedbat: Can you weigh in on these return codes, and perhaps suggest a cleaner way of handling things (similar things are happening here: https://github.com/edx/edx-platform/pull/1942/files#diff-03fed087942ff12728ffd75feb7f666eR27, with rationale here: https://github.com/edx/edx-platform/pull/654/files#diff-03fed087942ff12728ffd75feb7f666eR52)