From 6b4f456654951a6576372d2b264b2c0b180c27c8 Mon Sep 17 00:00:00 2001 From: ado Date: Sun, 6 Aug 2023 19:44:26 +0200 Subject: [PATCH] Update ssp.hpp --- ssp.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ssp.hpp b/ssp.hpp index 101ef9d..90494e9 100644 --- a/ssp.hpp +++ b/ssp.hpp @@ -2924,11 +2924,13 @@ private: void decorate_rethrow(const ss::exception& e) const { static_assert(throw_on_error, "throw_on_error needs to be enabled to use this method"); - throw ss::exception{std::string{file_name_} - .append(" ") - .append(std::to_string(reader_.line_number_)) - .append(": ") - .append(e.what())}; + auto line = reader_.line_number_; + throw ss::exception{ + std::string{file_name_} + .append(" ") + .append(std::to_string(line > 1 ? line - 1 : line)) + .append(": ") + .append(e.what())}; } ////////////////