Why not return a uint32_t, and make it zero if failure?  A node idx will never be zero in the db...