MCPcopy Create free account
hub / github.com/Clarionos/clarion / to_string

Method to_string

libraries/fc/src/exception.cpp:196–230  ·  view source on GitHub ↗

* Generates a user-friendly error report. */

Source from the content-addressed store, hash-verified

194 * Generates a user-friendly error report.
195 */
196 string exception::to_string( log_level ll )const
197 {
198 const auto deadline = fc::time_point::now() + format_time_limit;
199 std::stringstream ss;
200 try {
201 ss << my->_what;
202 try {
203 ss << " (" << variant( my->_code ).as_string() << ")\n";
204 } catch( std::bad_alloc& ) {
205 throw;
206 } catch( ... ) {
207 ss << "<- exception in to_string.\n";
208 }
209 for( auto itr = my->_elog.begin(); itr != my->_elog.end(); ++itr ) {
210 try {
211 FC_CHECK_DEADLINE(deadline);
212 ss << fc::format_string( itr->get_format(), itr->get_data(), true) << "\n";
213 // ss << " " << itr->get_context().to_string() <<"\n";
214 } catch( std::bad_alloc& ) {
215 throw;
216 } catch( const fc::timeout_exception& e) {
217 ss << "<- timeout exception in to_string: " << e.what();
218 break;
219 } catch( ... ) {
220 ss << "<- exception in to_string.\n";
221 }
222 }
223 return ss.str();
224 } catch( std::bad_alloc& ) {
225 throw;
226 } catch( ... ) {
227 ss << "<- exception in to_string.\n";
228 }
229 return ss.str();
230 }
231
232 /**
233 * Generates a user-friendly error report.

Callers 1

to_detail_stringMethod · 0.45

Calls 9

format_stringFunction · 0.85
as_stringMethod · 0.80
get_formatMethod · 0.80
get_dataMethod · 0.80
variantClass · 0.50
beginMethod · 0.45
endMethod · 0.45
whatMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected