mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avinash sridharan <avin...@mesosphere.io>
Subject Re: Review Request 51737: Added `PluginError` to simplify error reporting for CNI plugins.
Date Mon, 12 Sep 2016 19:28:06 GMT


> On Sept. 10, 2016, 1:15 a.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/spec.hpp, lines 63-66
> > <https://reviews.apache.org/r/51737/diff/1/?file=1495194#file1495194line63>
> >
> >     Why we need this?

If I don't have an `ostream` operator for `PluginError` the clang compiler fails:
../../src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/main.cpp:66:10:
error: invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>')
and 'const typename std::conditional<std::is_same<Plu
ginError, Error>::value, std::string, PluginError>::type' (aka 'const mesos::internal::slave::cni::spec::PluginError'))
    cout << portMapper.error() << endl;
    
I think its because of this :
https://github.com/apache/mesos/blob/bf7162205b53114eb7367fa322951d573cbb716d/3rdparty/stout/include/stout/try.hpp#L87

Earlier `.error()` used to return a `std::string` but now will return an object of type `E`
specified in the template for `Try`.


- Avinash


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51737/#review148393
-----------------------------------------------------------


On Sept. 12, 2016, 7:27 p.m., Avinash sridharan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51737/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2016, 7:27 p.m.)
> 
> 
> Review request for mesos, haosdent huang, Jie Yu, switched to 'mcypark', and Qian Zhang.
> 
> 
> Bugs: MESOS-6023
>     https://issues.apache.org/jira/browse/MESOS-6023
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added `PluginError` to simplify error reporting for CNI plugins.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/main.cpp 11c03fdf8a85414d20704299103e22be7d844f80

>   src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.hpp
85547533b0b13011615b512ec8c71b7545f33324 
>   src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.cpp
0ecf64f2de5fc27f208e9dd0e3608b9a6750e9a6 
>   src/slave/containerizer/mesos/isolators/network/cni/spec.hpp 2d0187beaf0d20e87d5a9ff80f5672ce7b8cc53b

> 
> Diff: https://reviews.apache.org/r/51737/diff/
> 
> 
> Testing
> -------
> 
> make
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message