<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I already had to fix some nasty deadlocks related to pthreads, destructors and exception handlers [...]</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Well, I also fixed quite a lot of bugs in pure C code (e.g. in OsmoMSC, see release notes for 1.5.0) - does it mean we should stop using C and switch to something else (I vote for Erlang)?</p><p style="white-space: pre-wrap; word-wrap: break-word;">This is a common pattern:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (error) {<br>    LOGP(SS, LEVEL, "Error message\n");<br>    return false; // or -ERRNO<br>  }</pre><p style="white-space: pre-wrap; word-wrap: break-word;">where you basically print a error message and break the execution flow.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Maybe I am missing something (given that my C++ experience is not that rich), but what's wrong with:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (error)<br>    throw "Error message";</pre><p style="white-space: pre-wrap; word-wrap: break-word;">and then:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  try {<br>    foo();<br>    // ...<br>  } catch (const char *e) {<br>    LOGP(SS, LEVEL, "Terminating process due to: %s\n", e);<br>  }</pre><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/15289">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/15289">change 15289</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-trx/+/15289"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2ccbe3c17b39fb792ea7810f840235c348054d66 </div>
<div style="display:none"> Gerrit-Change-Number: 15289 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 26 Aug 2019 14:20:00 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>