Skip to content

Commit b67fd7b

Browse files
committed
Fix lint: format test_shm_abort.py and keep concore.hpp exception behavior
1 parent b3fcd65 commit b67fd7b

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

concore.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,14 @@ class Concore{
632632
}
633633
}
634634

635-
catch(...){
636-
cout<<"skipping +"<<outpath<<port<<" /"<<name;
635+
catch (const std::exception &e) {
636+
// Surface the error message and rethrow so callers (or the runtime)
637+
// see the failure instead of silently proceeding with truncated data.
638+
std::cerr << e.what() << std::endl;
639+
throw;
640+
} catch (...) {
641+
// Unknown exception: rethrow to avoid silent suppression.
642+
throw;
637643
}
638644
}
639645

@@ -657,8 +663,11 @@ class Concore{
657663
}
658664
else throw 505;
659665
}
660-
catch(...){
661-
cout<<"skipping +"<<outpath<<port<<" /"<<name;
666+
catch (const std::exception &e) {
667+
std::cerr << e.what() << std::endl;
668+
throw;
669+
} catch (...) {
670+
throw;
662671
}
663672
}
664673

tests/test_shm_abort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _compile_and_run(payload_size):
3131
binary_file = temp_path / "shm_abort_test"
3232
source_file.write_text(
3333
textwrap.dedent(
34-
f'''
34+
f"""
3535
#include "concore.hpp"
3636
#include <exception>
3737
#include <string>
@@ -49,7 +49,7 @@ def _compile_and_run(payload_size):
4949
return 1;
5050
}}
5151
}}
52-
'''
52+
"""
5353
).lstrip(),
5454
encoding="utf-8",
5555
)

0 commit comments

Comments
 (0)