forked from organicmaps/organicmaps-tmp
Fix RootException message formatting.
This commit is contained in:
parent
5ebfd29c0d
commit
9bce8acff5
1 changed files with 12 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include "internal/message.hpp"
|
||||
#include "macros.hpp"
|
||||
#include "../std/algorithm.hpp"
|
||||
|
||||
#include "../std/exception.hpp"
|
||||
#include "../std/string.hpp"
|
||||
|
||||
|
@ -18,18 +18,21 @@ public:
|
|||
|
||||
virtual char const * what() const throw()
|
||||
{
|
||||
size_t const count = m_Msg.size();
|
||||
|
||||
string asciiMsg;
|
||||
for (size_t i = 0; i < m_Msg.size(); ++i)
|
||||
asciiMsg.resize(count);
|
||||
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
if (static_cast<unsigned char>(m_Msg[i]) < 128)
|
||||
{
|
||||
asciiMsg += char(m_Msg[i]);
|
||||
} else
|
||||
{
|
||||
asciiMsg += '?';
|
||||
}
|
||||
asciiMsg[i] = char(m_Msg[i]);
|
||||
else
|
||||
asciiMsg[i] = '?';
|
||||
}
|
||||
static string msg = string(m_What) + ", \"" + asciiMsg + "\"";
|
||||
|
||||
static string msg;
|
||||
msg = string(m_What) + ", \"" + asciiMsg + "\"";
|
||||
return msg.c_str();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue