Skip to content

Commit f75ccd0

Browse files
committed
cath exception when instrument is not configured
Signed-off-by: Jose Borreguero <borreguero@gmail.com>
1 parent ac271a3 commit f75ccd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/livereduce.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ def __getSetInstrument(self, instrument: str) -> InstrumentInfo:
217217

218218
if instrument is None:
219219
self.logger.info("Using default instrument")
220-
return ConfigService.getInstrument()
220+
instrument = ConfigService.getInstrument().strip()
221+
if len(instrument) == 0:
222+
raise RuntimeError("No instrument found in the configuration or Mantid.user.properties files")
223+
else:
224+
return instrument
221225
else:
222226
self.logger.info("Converting instrument using ConfigService")
223227
instrument_instance = ConfigService.getInstrument(str(instrument))

0 commit comments

Comments
 (0)