Add exceptions classes and tests

These are the same exceptions used in the board rules extension. They will work for Pages too.