let's create a new exception type CodeGenException maybe? And use that throughout the code