Put errors at root and swap error codes