Project

General

Profile

Bug #1092

assert statements in TOF code

Added by Rogers, Chris about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
TOF
Target version:
Start date:
06 August 2012
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

I had a complaint about the copious use of assert statements - as exceptions can be handled but asserts cannot. I notice that you use assert statements rather a lot in the tof code. I think it is better to throw an exception - because that can be handled whereas assert cannot. Would you mind changing out the asserts for exceptions? For example,

#include "src/legacy/Interface/Squeal.hh" 

throw(Squeal(Squeal::recoverable, "Some error message", "String::Location::ofTheCode"));

I even went so far as to disable assert statements at build time using an NDEBUG compile flag... so these asserts don't do anything right now.

#1

Updated by Rogers, Chris about 9 years ago

(I should add - you can set an environment variable, $maus_assert_active to activate asserts. But they should only be used for debugging)

#2

Updated by Rajaram, Durga about 9 years ago

I assume you're talking about the tof digitizer code? I'll fix it.

#3

Updated by Rogers, Chris about 9 years ago

Sorry, yes that's TOFMCDigitizer

#4

Updated by Rogers, Chris about 9 years ago

Looks like this is closed?

#5

Updated by Rajaram, Durga about 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Sorry -- yes.

#6

Updated by Rogers, Chris about 9 years ago

Great thanks

#7

Updated by Rogers, Chris about 9 years ago

  • Target version changed from Future MAUS release to MAUS-v0.3.2

Also available in: Atom PDF