This is an automated email from the ASF dual-hosted git repository.

bennoe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit d6c68d883b7094c12f62063ad28c7ecd0eae5d6f
Author: Benno Evers <[email protected]>
AuthorDate: Tue Mar 19 18:52:43 2019 +0100

    Displayed error message on resource validation failures.
    
    When pushing a reservation, the validation code would not
    print the error that caused validation to fail. This could
    result in developers scratching their heads in confusion.
    
    Review: https://reviews.apache.org/r/70206/
---
 src/v1/resources.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index 110be10..d3a6194 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -1728,7 +1728,10 @@ Resources Resources::pushReservation(
       resourcesNoMutationWithoutExclusiveOwnership) {
     Resource_ r_ = *resource_;
     r_.resource.add_reservations()->CopyFrom(reservation);
-    CHECK_NONE(Resources::validate(r_.resource));
+    Option<Error> validationError = Resources::validate(r_.resource);
+    CHECK_NONE(validationError)
+      << "Invalid resource " << r_ << ": " << validationError.get();
+
     result.add(std::move(r_));
   }
 

Reply via email to