I would add a constructor here that takes an error code constant directly.  This would tidy up the code that returns errors.  Something like:
```
MoveItErrorCode(int code) { val = code; }
```

That way returns can be a single line:
```
return MoveItErrorCode(moveit_msgs::MoveItErrorCodes::SUCCESS)
```