Allow nextId to return an error