From 028ad640442259ecbe7a5f8f93582f2da557426a Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 14 Oct 2016 13:54:36 +0200 Subject: Log TooLongStringException in the moment of creation Signed-off-by: Szczepan Zalega --- include/LibraryException.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/LibraryException.h b/include/LibraryException.h index 72891fb..3c3fab4 100644 --- a/include/LibraryException.h +++ b/include/LibraryException.h @@ -4,6 +4,7 @@ #include #include #include +#include "log.h" class LibraryException: std::exception { public: @@ -83,7 +84,10 @@ public: std::string message; TooLongStringException(size_t size_source, size_t size_destination, const std::string &message = "") : size_source( - size_source), size_destination(size_destination), message(message) {} + size_source), size_destination(size_destination), message(message) { + nitrokey::log::Log::instance()(std::string("TooLongStringException, size diff: ")+ std::to_string(size_source-size_destination), nitrokey::log::Loglevel::DEBUG); + + } virtual const char *what() const throw() override { //TODO add sizes and message data to final message -- cgit v1.2.1