You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Chun-Hung Hsiao <ch...@apache.org> on 2018/05/16 22:02:04 UTC

Review Request 67164: Supported custom error types for `Try` in `AssertSome`.

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

Review request for mesos, Benjamin Bannier, Benjamin Mahler, Jie Yu, and Zhitao Li.


Bugs: MESOS-8924
    https://issues.apache.org/jira/browse/MESOS-8924


Repository: mesos


Description
-------

Supported custom error types for `Try` in `AssertSome`.


Diffs
-----

  3rdparty/stout/include/stout/gtest.hpp a40e8101b5c09d419462212e5871fe382f572bf4 


Diff: https://reviews.apache.org/r/67164/diff/1/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 67164: Supported custom error types for `Try` in `AssertSome`.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67164/#review203314
-----------------------------------------------------------



Thanks for tackling this.

Could you link MESOS-7220? We should also clean up uses of `EXPECT_TRUE(.*isError())` and `ASSERT_TRUE(.*isError())` in follow-up patches.


3rdparty/stout/include/stout/gtest.hpp
Lines 61 (patched)
<https://reviews.apache.org/r/67164/#comment285421>

    While this gets the job done, it couples us rather tightly to `Error` as opposed to being generic (we e.g., assume that `E::message()` exists which works since `Try` enforces any of its `E` to derive from `Error`).
    
    What would you think about instead adding a
    
        ostream& operator<<(ostream&, const Error&);
        
    and additionally parameterizing the existing `AssertSome` on `E` as well? That would not only decouple us from the requirements `Try` puts on `E`, but also provide a dedicated future customization point for how custom error types are represented (currently just through how the base `Error` is constructed). It would also not require us to duplicate the implementation.


- Benjamin Bannier


On May 17, 2018, 12:02 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67164/
> -----------------------------------------------------------
> 
> (Updated May 17, 2018, 12:02 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, Jie Yu, and Zhitao Li.
> 
> 
> Bugs: MESOS-8924
>     https://issues.apache.org/jira/browse/MESOS-8924
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Supported custom error types for `Try` in `AssertSome`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/gtest.hpp a40e8101b5c09d419462212e5871fe382f572bf4 
> 
> 
> Diff: https://reviews.apache.org/r/67164/diff/1/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 67164: Supported custom error types for `Try` in `AssertSome`.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67164/#review203401
-----------------------------------------------------------


Ship it!




Ship It!

- Benjamin Bannier


On May 17, 2018, 8:10 p.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67164/
> -----------------------------------------------------------
> 
> (Updated May 17, 2018, 8:10 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, Jie Yu, and Zhitao Li.
> 
> 
> Bugs: MESOS-7220
>     https://issues.apache.org/jira/browse/MESOS-7220
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Supported custom error types for `Try` in `AssertSome`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/errorbase.hpp 173852ff8f25e8c97decf1c2a6326aec223e9fa2 
>   3rdparty/stout/include/stout/gtest.hpp a40e8101b5c09d419462212e5871fe382f572bf4 
> 
> 
> Diff: https://reviews.apache.org/r/67164/diff/2/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 67164: Supported custom error types for `Try` in `AssertSome`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67164/
-----------------------------------------------------------

(Updated May 17, 2018, 6:10 p.m.)


Review request for mesos, Benjamin Bannier, Benjamin Mahler, Jie Yu, and Zhitao Li.


Changes
-------

Addressed Benjamin's comments.


Bugs: MESOS-8924
    https://issues.apache.org/jira/browse/MESOS-8924


Repository: mesos


Description
-------

Supported custom error types for `Try` in `AssertSome`.


Diffs (updated)
-----

  3rdparty/stout/include/stout/errorbase.hpp 173852ff8f25e8c97decf1c2a6326aec223e9fa2 
  3rdparty/stout/include/stout/gtest.hpp a40e8101b5c09d419462212e5871fe382f572bf4 


Diff: https://reviews.apache.org/r/67164/diff/2/

Changes: https://reviews.apache.org/r/67164/diff/1-2/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao