+1 on Dave's suggestion. I would actually add a second constructor as well, where the argument is const moveit_msgs::MoveItErrorCodes&;