Add ErrorRegister classes to simplify error handling
Add test if compile() raises an CompilationError