<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/llcommon/llexception.h, branch main</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://www.megapahit.org/viewer.git/atom?h=main</id>
<link rel='self' href='https://www.megapahit.org/viewer.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/'/>
<updated>2025-06-03T08:21:58Z</updated>
<entry>
<title>Revert "Promote seh_catcher() et al. to llexception.{h,cpp} for general use."</title>
<updated>2025-06-03T08:21:58Z</updated>
<author>
<name>Erik Kundiman</name>
<email>erik@megapahit.org</email>
</author>
<published>2025-06-03T08:21:58Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=bbe51e86249114cac4716c391e267c499a52847a'/>
<id>urn:sha1:bbe51e86249114cac4716c391e267c499a52847a</id>
<content type='text'>
This reverts commit 71d777ea126e7f02cb46c11bdb606094ca06f75c.
</content>
</entry>
<entry>
<title>Revert "Fix up llexception.h's cross-platform SEH wrapper."</title>
<updated>2025-06-03T08:20:27Z</updated>
<author>
<name>Erik Kundiman</name>
<email>erik@megapahit.org</email>
</author>
<published>2025-06-03T08:20:27Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=9bae19198fdc7bfb71f900cfe6c1982cb2a80e4f'/>
<id>urn:sha1:9bae19198fdc7bfb71f900cfe6c1982cb2a80e4f</id>
<content type='text'>
This reverts commit 5ed8df22cd59680a685c4ada7daa5555bf59d4fe.
</content>
</entry>
<entry>
<title>Fix up llexception.h's cross-platform SEH wrapper.</title>
<updated>2024-05-28T17:22:05Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2024-05-28T17:22:05Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=5ed8df22cd59680a685c4ada7daa5555bf59d4fe'/>
<id>urn:sha1:5ed8df22cd59680a685c4ada7daa5555bf59d4fe</id>
<content type='text'>
Introduce AlwaysReturn&lt;void&gt; specialization, which always discards any result
of calling the specified callable with specified args.

Derive new Windows_SEH_exception from LLException, not std::runtime_error.

Put the various SEH functions in LL::seh nested namespace, e.g.
LL::seh::catcher() as the primary API.

Break out more levels of Windows SEH handler to work around the restrictions on
functions containing __try/__except.

The triadic catcher() overload now does little save declare a std::string
stacktrace before forwarding the call to catcher_inner(), passing a reference
to stacktrace along with the trycode, filter and handler functions.

catcher_inner() accepts the stacktrace and the three function template
arguments. It contains the __try/__except logic. It calls a new filter_()
wrapper template, which calls fill_stacktrace() before forwarding the call to
the caller's filter function. fill_stacktrace(), in the .cpp file, contains
the logic to populate the stacktrace string -- unless the Structured Exception
is stack overflow, in which case it puts an explanatory string instead.

catcher_inner()'s __except clause passes not only the code, but also the
stacktrace string, to the caller's handler function. It wraps the caller's
handler function in always_return&lt;rtype&gt;(), where rtype is the type returned
by the trycode function. This allows a handler to return a value, while also
supporting the void handler case, e.g. one that throws a C++ exception. (This
is why we need AlwaysReturn&lt;void&gt;: some trycode() functions are themselves
void.)

For the dyadic catcher() overload, introduce common_filter() containing the
logic to distinguish a C++ exception from any other kind of Structured
Exception. The fact that the stacktrace is captured before the filter function
is called should permit capturing a stacktrace for a C++ exception as well as
for most other Structured Exceptions.

As before, the monadic catcher() overload supplies the rethrow() handler, in
the .cpp file.

Change existing calls from seh_catcher() to LL::seh::catcher().
</content>
</entry>
<entry>
<title>Promote seh_catcher() et al. to llexception.{h,cpp} for general use.</title>
<updated>2024-05-24T21:34:04Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2024-05-24T21:34:04Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=71d777ea126e7f02cb46c11bdb606094ca06f75c'/>
<id>urn:sha1:71d777ea126e7f02cb46c11bdb606094ca06f75c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed</title>
<updated>2024-04-29T04:56:09Z</updated>
<author>
<name>Andrey Lihatskiy</name>
<email>alihatskiy@productengine.com</email>
</author>
<published>2024-04-29T04:43:28Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=1b68f71348ecf3983b76b40d7940da8377f049b7'/>
<id>urn:sha1:1b68f71348ecf3983b76b40d7940da8377f049b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>SL-14347 Crash at ChoosePixelFormat SEH</title>
<updated>2020-12-01T16:22:24Z</updated>
<author>
<name>Andrey Kleshchev</name>
<email>andreykproductengine@lindenlab.com</email>
</author>
<published>2020-12-01T16:21:43Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=bb4d02446fa215520a11f219ebca453d2dea0388'/>
<id>urn:sha1:bb4d02446fa215520a11f219ebca453d2dea0388</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-476: Enrich LLExceptions thrown by LLTHROW() with stack trace.</title>
<updated>2020-03-25T23:21:16Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-11-19T01:22:45Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=9ef702db1149b6961a4c9b158bf203007c0d3a92'/>
<id>urn:sha1:9ef702db1149b6961a4c9b158bf203007c0d3a92</id>
<content type='text'>
The LLTHROW() abstraction allows us to enrich the subject exception with a
boost::stacktrace -- without having to propagate the boost/stacktrace.hpp
header throughout the code base.

To my delight, our existing use of
boost::current_exception_diagnostic_information() already reports the newly
added boost::stacktrace information -- we don't have to query it specifically!
</content>
</entry>
<entry>
<title>MAINT-5011: Catch unhandled exceptions in LLCoros coroutines.</title>
<updated>2016-08-18T21:33:44Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2016-08-18T21:33:44Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=4d10172d8b2c72fa809e322a3b4ff326b19ff340'/>
<id>urn:sha1:4d10172d8b2c72fa809e322a3b4ff326b19ff340</id>
<content type='text'>
Wrap coroutine call in try/catch in top-level coroutine wrapper function
LLCoros::toplevel(). Distinguish exception classes derived from
LLContinueError (log and continue) from all others (crash with LL_ERRS).

Enhance CRASH_ON_UNHANDLED_EXCEPTIONS() and LOG_UNHANDLED_EXCEPTIONS() macros
to accept a context string to supplement the log message. This lets us replace
many places that called boost::current_exception_diagnostic_information() with
LOG_UNHANDLED_EXCEPTIONS() instead, since the explicit calls were mostly to
log supplemental information.

Provide supplemental information (coroutine name, function parameters) for
some of the previous LOG_UNHANDLED_EXCEPTIONS() calls. This information
duplicates LL_DEBUGS() information at the top of these functions, but in a
typical log file we wouldn't see the LL_DEBUGS() message.

Eliminate a few catch (std::exception e) clauses: the information we get from
boost::current_exception_diagnostic_information() in a catch (...) clause
makes it unnecessary to distinguish.

In a few cases, add a final 'throw;' to a catch (...) clause: having logged
the local context info, propagate the exception to be caught by higher-level
try/catch.

In a couple places, couldn't resist reconciling indentation within a
particular function: tabs where the rest of the function uses tabs, spaces
where the rest of the function uses spaces.

In LLLogin::Impl::loginCoro(), eliminate some confusing comments about an
array of rewritten URIs that date back to a long-deleted implementation.
</content>
</entry>
<entry>
<title>MAINT-5011: Use BOOST_CURRENT_FUNCTION instead of __PRETTY_FUNCTION__</title>
<updated>2016-08-18T15:06:51Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2016-08-18T15:06:51Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=c7bf8af6378a54c3d03e77b161b7ba3b36186576'/>
<id>urn:sha1:c7bf8af6378a54c3d03e77b161b7ba3b36186576</id>
<content type='text'>
since Visual Studio doesn't know __PRETTY_FUNCTION__, and Boost already has a
portable macro to Do The Right Thing.
</content>
</entry>
<entry>
<title>MAINT-5011: Try to enrich catch (...) logging throughout viewer.</title>
<updated>2016-08-17T19:40:03Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2016-08-17T19:40:03Z</published>
<link rel='alternate' type='text/html' href='https://www.megapahit.org/viewer.git/commit/?id=993f54f6e91d78a9c2e1389ad878d6bd46e9be5b'/>
<id>urn:sha1:993f54f6e91d78a9c2e1389ad878d6bd46e9be5b</id>
<content type='text'>
Turns out we have a surprising number of catch (...) clauses in the viewer
code base. If all we currently do is

    LL_ERRS() &lt;&lt; "unknown exception" &lt;&lt; LL_ENDL;

then call CRASH_ON_UNHANDLED_EXCEPTION() instead. If what we do is

    LL_WARNS() &lt;&lt; "unknown exception" &lt;&lt; LL_ENDL;

then call LOG_UNHANDLED_EXCEPTION() instead.

Since many places need LOG_UNHANDLED_EXCEPTION() and nobody catches
LLContinueError yet, eliminate LLContinueError&amp; parameter from
LOG_UNHANDLED_EXCEPTION(). This permits us to use the same log message as
CRASH_ON_UNHANDLED_EXCEPTION(), just with a different severity level.

Where a catch (...) clause actually provides contextual information, or makes
an error string, add boost::current_exception_diagnostic_information() to try
to figure out actual exception class and message.
</content>
</entry>
</feed>
