Skip to content

Commit 94fdcd6

Browse files
authored
Merge pull request #314 from pathsim/refactor/surface-recorder-read-errors
Surface recorder read failures on stderr
2 parents 7b8512a + 0ffae1d commit 94fdcd6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/lib/pyodide/pythonHelpers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ def _extract_scope_data(blocks, node_id_map, incremental=False):
129129
'labels': labels
130130
}
131131
except Exception as e:
132-
print(f"Error reading Scope: {e}")
132+
# stderr (not stdout) so a failing recorder surfaces as an
133+
# error in the console instead of an unexplained empty plot.
134+
print(f"Error reading Scope: {e}", file=__import__('sys').stderr)
133135
elif block_name == 'Subsystem':
134136
if hasattr(block, 'blocks'):
135137
find_scopes(block.blocks)
@@ -177,7 +179,9 @@ def _extract_spectrum_data(blocks, node_id_map):
177179
'labels': labels
178180
}
179181
except Exception as e:
180-
print(f"Error reading Spectrum: {e}")
182+
# stderr (not stdout) so a failing recorder surfaces as an
183+
# error in the console instead of an unexplained empty plot.
184+
print(f"Error reading Spectrum: {e}", file=__import__('sys').stderr)
181185
elif block_name == 'Subsystem':
182186
if hasattr(block, 'blocks'):
183187
find_spectrums(block.blocks)

0 commit comments

Comments
 (0)