aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-14 13:54:36 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-10-19 16:34:34 +0200
commit028ad640442259ecbe7a5f8f93582f2da557426a (patch)
tree94bcc70c5b1f6829b4bdd0571a390f300495472f
parentc2d8ba24fd7ea65d77d6a3f2a70764095575bcd0 (diff)
downloadlibnitrokey-028ad640442259ecbe7a5f8f93582f2da557426a.tar.gz
libnitrokey-028ad640442259ecbe7a5f8f93582f2da557426a.tar.bz2
Log TooLongStringException in the moment of creation
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--include/LibraryException.h6
1 files changed, 5 insertions, 1 deletions
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 <exception>
#include <cstdint>
#include <string>
+#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