current_exception_diagnostic_information.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
  2. 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
  4. <head>
  5. <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
  6. <title>current_exception_diagnostic_information</title>
  7. <link href='reno.css' type='text/css' rel='stylesheet'/>
  8. </head>
  9. <body>
  10. <div class="body-0">
  11. <div class="body-1">
  12. <div class="body-2">
  13. <div>
  14. <div id="boost_logo">
  15. <a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
  16. </div>
  17. <h1>Boost Exception</h1>
  18. </div>
  19. <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
  20. <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
  21. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  22. <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception_diagnostic_information</h3>
  23. </div>
  24. <div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/></p>
  25. <pre>namespace
  26. boost
  27. {
  28. <span class="RenoIncludeSPAN"> std::string <span class="RenoLink">current_exception_diagnostic_information</span>();</span>
  29. }</pre>
  30. </div><h4>Requirements:</h4>
  31. <p>This function must not be called outside of a catch block.</p>
  32. <h4>Returns:</h4>
  33. <p>If the current exception object can be converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span> or std::exception, this function returns the same string value returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> for the current exception object. Otherwise, an unspecified non-empty string is returned.</p>
  34. <p>Typical use is to call <span class="RenoLink">current_exception_diagnostic_information</span> from a top-level function to output diagnostic information about unhandled exceptions:</p>
  35. <pre>int
  36. main()
  37. {
  38. try
  39. {
  40. run_program();
  41. }
  42. catch(
  43. error &amp; e )
  44. {
  45. //handle error
  46. }
  47. catch(
  48. ...)
  49. {
  50. std::cerr &lt;&lt; "Unhandled exception!" &lt;&lt; std::endl &lt;&lt;
  51. boost::<span class="RenoLink">current_exception_diagnostic_information</span>();
  52. }
  53. }</pre>
  54. </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
  55. See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
  56. </div>
  57. <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
  58. <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
  59. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  60. <div id="footer">
  61. <p>
  62. <a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
  63. <a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
  64. <small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
  65. Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
  66. </p>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </body>
  72. </html>