SAP Knowledge Base Article - Public

3333877 - Try-expect-continue block behavior change after 2305 update

Symptom

Try-catch-continue block isn't working on scripts.

Example:

for i in range(10):
    try:
        Trace.Write(str(1.0 / i))
    except:
        Trace.Write('Exception')
        continue
    Trace.Write('No Exception')

Environment

SAP Sales Cloud CPQ

Reproducing the Issue

Utilize scripts that incorporate a Try-catch-continue block.

Cause

Using a thy-catch-exception code construct leads to stack overflow problems. It's a known bug in IronPython and it's been disabled since 2305 release.

Resolution

Substitute the continue statement, which omits the execution of specific code following the except clause, with a conditional clause such as else.

Example:

for i in range(10):
    try:
        Trace.Write(str(1.0 / i))
    except:
        Trace.Write('Exception')
    else:
        Trace.Write('No Exception')

Keywords

try, catch, continue, CPQ, script, change, error , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Problem

Product

SAP CPQ 2023