Remember the error codes are additive. For example if you have an error 32 and an error 8 it will show as error 40.
The easiest way to check codes is through their query tool. It will list all applicable codes.
Right! They are bit or. I was automating this for an open source project but It should be pretty straightforward to do this from python.
https://github.com/anselal/antminer-monitor