Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8579

TApplication::ProcessLine / ExecuteFile does not return error state if file not present

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.34/36
    • Fix Version/s: 6.10/00, 6.08/06
    • Component/s: None
    • Labels:
      None
    • Environment:

      Gentoo Linux x86_64

      Description

      Dear ROOTers,

      I just noted that the following does not return any programmatic error state whatsoever (only a message is printed). Assuming "foo.C" does not exist in the current directory, I get with ROOT 5:

      root [0] TInterpreter::EErrorCode interpreterError
      root [1] TString execLine(".x foo.C");
      root [2] gROOT->ProcessLine(execLine.Data(), (int*)(&interpreterError))
      Error in <TApplication::ExecuteFile>: macro foo.C not found in path .:/usr/share/root/macros:
      (Long_t)0
      root [3] interpreterError
      (enum TInterpreter::EErrorCode)0

      Note that both the interpreterError value and the return value of ProcessLine do not indicate any error.

      With ROOT 6:

      root [0] TInterpreter::EErrorCode interpreterError
      (TInterpreter::EErrorCode) (TInterpreter::EErrorCode::kNoError) : (unsigned int) 0
      root [1] TString execLine(".x foo.C");
      root [2] gROOT->ProcessLine(execLine.Data(), (int*)(&interpreterError))
      Error in <TApplication::ExecuteFile>: macro foo.C not found in path .:/usr/share/root/macros
      (long) 0
      root [3] interpreterError
      (TInterpreter::EErrorCode) (TInterpreter::EErrorCode::kNoError) : (unsigned int) 0

      By the way, nice that the new value printer explicitly shows that the enum value corresponds to "kNoError" .

      As a workaround, of course I can just check (e.g. TSystem::GetPathInfo) before whether the file exists, which I implement now. Still, it would be nice if an error would be indicated in some way...

      Cheers,
      Oliver

        Attachments

          Activity

            People

            • Assignee:
              axel Axel Naumann
              Reporter:
              ofreyerm Oliver Freyermuth
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: