Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

waitForConfig() is swallowing exceptions #400

Open
hinderling opened this issue Nov 6, 2023 · 1 comment
Open

waitForConfig() is swallowing exceptions #400

hinderling opened this issue Nov 6, 2023 · 1 comment

Comments

@hinderling
Copy link

hinderling commented Nov 6, 2023

As discussed in micro-manager/pymmcore#90 there seems to be unexpected behaviour in waitForConfig(), where errors are logged but ignored:

void CMMCore::waitForConfig(const char* group, const char* configName) throw (CMMError)
{
   CheckConfigGroupName(group);
   CheckConfigPresetName(configName);

   Configuration cfg = getConfigData(group, configName);
   try {
      for(size_t i=0; i<cfg.size(); i++)
         waitForDevice(cfg.getSetting(i).getDeviceLabel().c_str());
   } catch (CMMError& err) {
      // trap MM exceptions and keep quiet - this is not a good time to blow up
      logError("waitForConfig", err.getMsg().c_str());
   }
}

For comparison, in waitForSystem() errors like e.g. a device timeout error are propagated from waitForDevice()->waitForDeviceType()->waitForSystem().

As by @marktsuchida, it's been this way since 2007, so changing this would probably break existing scripts.

@marktsuchida
Copy link
Member

Thanks for creating the issue. We might be able to slowly migrate this to throwing using the new "feature" facility (#394/#399).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants