@@ -295,21 +295,24 @@ where
295
295
// Some of these errors are from operations in the Runtime or SDK layer
296
296
// before or after the underlying VM send syscall.
297
297
ErrorNumber :: NotFound => {
298
- // How do we know the receiver is what triggered this?
299
- // An error number doesn't carry enough information at this level
300
- // above the raw syscall (and even then).
301
- actor_error ! ( not_found; "receiver not found" )
298
+ // This means that the receiving actor doesn't exist.
299
+ // TODO: we can't reasonably determine the correct "exit code" here.
300
+ actor_error ! ( unspecified; "receiver not found" )
302
301
}
303
302
ErrorNumber :: InsufficientFunds => {
304
- // Actually this is more like an illegal argument where the caller attempted
305
- // to transfer an amount larger than that representable by the VM's
306
- // token amount type. Yes, the caller doesn't have that amount, but if they'd
307
- // attempted to transfer a representable amount it would fail with
308
- // SYS_INSUFFICIENT_FUNDS instead, so this difference is wierd.
303
+ // This means that the send failed because we have insufficient funds. We will
304
+ // get a _syscall error_, not an exit code, because the target actor will not
305
+ // run (and therefore will not exit).
309
306
actor_error ! ( insufficient_funds; "not enough funds" )
310
307
}
308
+ ErrorNumber :: LimitExceeded => {
309
+ // This means we've exceeded the recursion limit.
310
+ // TODO: Define a better exit code.
311
+ actor_error ! ( user_assertion_failed; "recursion limit exceeded" )
312
+ }
311
313
err => {
312
- actor_error ! ( unspecified; "unexpected error: {}" , err)
314
+ // We don't expect any other syscall exit codes.
315
+ actor_error ! ( user_assertion_failed; "unexpected error: {}" , err)
313
316
}
314
317
} ) ,
315
318
}
@@ -456,7 +459,7 @@ pub fn trampoline<C: ActorCode>(params: u32) -> u32 {
456
459
let ret = C :: invoke_method ( & mut rt, method, & params)
457
460
. unwrap_or_else ( |err| fvm:: vm:: abort ( err. exit_code ( ) . value ( ) , Some ( err. msg ( ) ) ) ) ;
458
461
459
- // Abort with "unspecified " if the actor failed to validate the caller somewhere.
462
+ // Abort with "assertion failed " if the actor failed to validate the caller somewhere.
460
463
// We do this after handling the error, because the actor may have encountered an error before
461
464
// it even could validate the caller.
462
465
if !rt. caller_validated {
0 commit comments