Skip to content

Commit 04fa753

Browse files
committed
Panic in release binaries too
1 parent a19dd6f commit 04fa753

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/ark/src/console.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,12 @@ impl Console {
648648
.log_err();
649649
}
650650

651-
// Initialize support functions (after routine registration, after r_task initialization)
651+
// Initialize support functions (after routine registration, after
652+
// r_task initialization). Intentionally panic if module loading
653+
// fails. Modules are critical for ark to function.
652654
match modules::initialize() {
653655
Err(err) => {
654-
log::error!("Can't load R modules: {err:?}");
656+
panic!("Failed to load R modules: {err:?}");
655657
},
656658
Ok(namespace) => {
657659
console.positron_ns = Some(namespace);

crates/ark/src/modules.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ pub fn initialize() -> anyhow::Result<RObject> {
152152
}
153153

154154
// Finish initialization of modules
155-
RFunction::from("initialize")
156-
.call_in(namespace.sexp)
157-
.log_err();
155+
RFunction::from("initialize").call_in(namespace.sexp)?;
158156

159157
// Do this separately with a bare eval because `errors_initialize()` should
160158
// be called without any condition handlers on the stack

0 commit comments

Comments
 (0)