Closed lmoureaux closed 4 years ago
The template RPC framework supports exceptions to signal failures, and the readReg functions were rewritten to throw on failure instead of returning 0xdeaddead. Two places in utils.cpp still compare against 0xdeaddead to check for errors: https://github.com/cms-gem-daq-project/ctp7_modules/blob/feature/templated-rpc-methods/src/utils.cpp#L527 and https://github.com/cms-gem-daq-project/ctp7_modules/blob/feature/templated-rpc-methods/src/utils.cpp#L494
readReg
0xdeaddead
utils.cpp
0xdeaddead doesn't have a special meaning
repeatedRegRead and writeReg will fail on 0xdeaddead
repeatedRegRead
writeReg
Use try...catch
try
catch
Noticed while reading the code
feature/templated-rpc-methods
Brief summary of issue
The template RPC framework supports exceptions to signal failures, and the
readReg
functions were rewritten to throw on failure instead of returning0xdeaddead
. Two places inutils.cpp
still compare against0xdeaddead
to check for errors: https://github.com/cms-gem-daq-project/ctp7_modules/blob/feature/templated-rpc-methods/src/utils.cpp#L527 and https://github.com/cms-gem-daq-project/ctp7_modules/blob/feature/templated-rpc-methods/src/utils.cpp#L494Types of issue
Expected Behavior
0xdeaddead
doesn't have a special meaningCurrent Behavior
repeatedRegRead
andwriteReg
will fail on0xdeaddead
Possible Solution (for bugs)
Use
try
...catch
Context (for feature requests)
Noticed while reading the code
Your Environment
feature/templated-rpc-methods
@ 7a6901b