That code looks fine to me. On the scheme side you'll want a catch somewhere. The other common choice is to return some error indication, and then the scheme side has to check for that. All the s7 C-library tie-ins (like libgsl) call s7_error.