Move error code out to error.go