fix: raise correct style of panic/signal when runtime errors occur
@@ -1136,18 +1136,18 @@ impl Process {
pub fn return_status(&self, result: exception::Result<Term>) -> Term {
match result {
Ok(term) => term,
- Err(exception) => {
- *self.status.write() = match exception {
+ Err(exception) => match exception {
+ Exception::System(SystemException::Alloc(_)) => {
+ self::ffi::set_process_signal(ProcessSignal::GarbageCollect);
+ Term::NONE
+ }
Exception::System(system_exception) => {
- Status::SystemException(system_exception)
+ panic!("{}", &system_exception);
}
Exception::Runtime(runtime_exception) => {
- Status::RuntimeException(runtime_exception)
- }
- };
-
- Term::NONE
+ self::ffi::process_raise(self, runtime_exception);
}
+ },
}
}
