aboutsummaryrefslogtreecommitdiff
path: root/include/LibraryException.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 17:18:59 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 17:18:59 +0100
commit22d05ce647281056d71fbd3c31df3bcd6396188d (patch)
tree90208930f54c47987bfd5ffcf0a0acaaad2510da /include/LibraryException.h
parented5044da43172d86a1aa475473561a4818b7c69c (diff)
parentac6b9c18ef55f4cd36e85069cf0cf82c14e04404 (diff)
downloadlibnitrokey-22d05ce647281056d71fbd3c31df3bcd6396188d.tar.gz
libnitrokey-22d05ce647281056d71fbd3c31df3bcd6396188d.tar.bz2
Merge branch 'libnitrokey_3'
Diffstat (limited to 'include/LibraryException.h')
-rw-r--r--include/LibraryException.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/LibraryException.h b/include/LibraryException.h
index 3c3fab4..b9303ad 100644
--- a/include/LibraryException.h
+++ b/include/LibraryException.h
@@ -11,8 +11,6 @@ public:
virtual uint8_t exception_id()= 0;
};
-
-
class TargetBufferSmallerThanSource: public LibraryException {
public:
virtual uint8_t exception_id() override {
@@ -29,7 +27,7 @@ public:
virtual const char *what() const throw() override {
std::string s = " ";
- auto ts = [](int x){ return std::to_string(x); };
+ auto ts = [](size_t x){ return std::to_string(x); };
std::string msg = std::string("Target buffer size is smaller than source: [source size, buffer size]")
+s+ ts(source_size) +s+ ts(target_size);
return msg.c_str();
@@ -85,7 +83,7 @@ public:
TooLongStringException(size_t size_source, size_t size_destination, const std::string &message = "") : size_source(
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);
+ LOG(std::string("TooLongStringException, size diff: ")+ std::to_string(size_source-size_destination), nitrokey::log::Loglevel::DEBUG);
}