Add in errorcode.

Added in our own defined errorcode. I also fixed the test failures. They are passing.