# If the process inside spawn fails

**URL:** <https://www.ruby-forum.com/t/if-the-process-inside-spawn-fails/140154>\
**Category:** Rails\
**Created:** [June 11, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/if-the-process-inside-spawn-fails/140154 "2008-06-11T12:46:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [June 11, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/if-the-process-inside-spawn-fails/140154/1 "2008-06-11T12:46:11Z")

</div>

Hi  
I have used spawn pluggin successfully in my test rails project(will  
use in original) for spawning process  
[http://rubyforge.org/projects/spawn/](http://rubyforge.org/projects/spawn/)

My controller code as below  
class UserController \< ApplicationController  
def create  
t=spawn do  
sending\_mail\_function(@user)  
end

def sending\_mail\_function(user)  
d=LateNotice.deliver\_late\_timesheet(user)  
end

end  
end

LateNotice is classs derived from action mailer…My question is suppose  
sending mail function failured how can I track that?Just for example  
after clicking mail send button i ahve to send 3 mails to a particular  
user. I am disconnecting the LAN cable(just for example)…So in that  
case also a new spawn id is returned and the execution after spawn will  
continue…But actually mail not send…How can I track this in above

Sijo
