Report exception locations and exception-related polish (#119)
Without location, many exceptions look identical: A growing number of
Must(entry != NULL) and Must(request) complicate triage. The location
info was already stored in TextException but was not reported.
Reporting exception location on a separate line makes admin-visible
FATAL/ERROR/WARNING messages easier to comprehend, and their primary
text becomes more "stable", which is good for documentation. Also, some
future exceptions will probably report multiple details, possibly even
context details collected as a low-level exception bubbles up to its
high-level handling/reporting code.
Also simplified/optimized TextException:
* TextException now reuses std::runtime_error message memory management
code, including its CoW optimizations/guarantees.
* Debug and TextException code now share the source location reporting
code (including Squid build prefix elision) in base/Here.{cc,h}.
Also simplified and polished SBuf-related exceptions, removing a few:
* Removed InvalidParamException as unused.
* Replaced SBufTooBigException with generic exceptions.
SBufTooBigException was misused (by SBuf::plength) and not useful. No
need to create a whole class just to parameterize an object!
* Replaced OutOfBoundsException with a generic exception.
OutOfBoundsException was not very useful (see SBufTooBigException). It
was used by one test case, that did not justify adding a whole class.
Also added SWALLOW_EXCEPTIONS() API to protect any code that may throw
unwanted exceptions. Reworked a few destructors after Must() changes
made it easier for GCC v6 to detect (and warn about) throwing code:
* Polished Ipc::Forwarder cleanup sequence. For Forwarders, I see no
reason to split/duplicate swanSong() functionality via a cleanup()
method. The swanSong() API exists so that job destructors do not need
to make confusing virtual method calls!
* Hid the AsyncJob destructor because all jobs should be "automatically"
deleted by the internal job code that guarantees a swanSong() call.
* Removed a bad (pair-less) StoreEntry::unregisterAbort() call from
Mgr::Forwarder destructor, possibly left behind in or around
51ea090.
* Removed ctor/dtor entrance debugging from the classes affected by the
"throwing destructor issue". AsyncJob covers that debugging need.
* TODO: Adjust all throwing destructors.