File tree 1 file changed +14
-3
lines changed
actors/runtime/src/runtime
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -271,12 +271,23 @@ where
271
271
// The returned code can't be simply propagated as it may be a system exit code.
272
272
// TODO: improve propagation once we return a RuntimeError.
273
273
// Ref https://github.com/filecoin-project/builtin-actors/issues/144
274
- Err ( actor_error ! (
275
- user_assertion_failed,
274
+ let exit_code = match ret. exit_code {
275
+ // This means the called actor did something wrong. We can't "make up" a
276
+ // reasonable exit code.
277
+ ExitCode :: SYS_MISSING_RETURN
278
+ | ExitCode :: SYS_ILLEGAL_INSTRUCTION
279
+ | ExitCode :: SYS_ILLEGAL_EXIT_CODE => ExitCode :: USR_UNSPECIFIED ,
280
+ // We don't expect any other system errors.
281
+ code if code. is_system_error ( ) => ExitCode :: USR_ASSERTION_FAILED ,
282
+ // Otherwise, pass it through.
283
+ code => code,
284
+ } ;
285
+ Err ( ActorError :: unchecked (
286
+ exit_code,
276
287
format ! (
277
288
"send to {} method {} aborted with code {}" ,
278
289
to, method, ret. exit_code
279
- )
290
+ ) ,
280
291
) )
281
292
}
282
293
}
You can’t perform that action at this time.
0 commit comments