From 5cc13cb16f8f32f69cce238856eaa00a39f6a4ad Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Tue, 14 Jun 2016 17:36:18 +0200 Subject: [PATCH] Improved error message --- src/TimeRange.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TimeRange.cpp b/src/TimeRange.cpp index 72e3d8d..cfe3dc6 100644 --- a/src/TimeRange.cpp +++ b/src/TimeRange.cpp @@ -1,6 +1,7 @@ #include "TimeRange.h" #include #include +#include using time_type = TimeRange::time_type; @@ -13,7 +14,9 @@ TimeRange::TimeRange(time_type start, time_type end) : start(start), end(end) { - if (start > end) throw std::invalid_argument("Start must not be less than end."); + if (start > end) { + throw std::invalid_argument(fmt::format("Time range start must not be less than end. Start: {0}, end: {1}", start, end)); + } } time_type TimeRange::getStart() const {