fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15289 )

Change subject: Transceiver: exit process when BTS drops connection
......................................................................


Patch Set 3:

> I already had to fix some nasty deadlocks related to pthreads, destructors 
> and exception handlers [...]

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)?

This is a common pattern:

  if (error) {
    LOGP(SS, LEVEL, "Error message\n");
    return false; // or -ERRNO
  }

where you basically print a error message and break the execution flow.

Maybe I am missing something (given that my C++ experience is not that rich), 
but what's wrong with:

  if (error)
    throw "Error message";

and then:

  try {
    foo();
    // ...
  } catch (const char *e) {
    LOGP(SS, LEVEL, "Terminating process due to: %s\n", e);
  }


--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/15289
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I2ccbe3c17b39fb792ea7810f840235c348054d66
Gerrit-Change-Number: 15289
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-Comment-Date: Mon, 26 Aug 2019 14:20:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to