Whenever a site is down it keeps on looking for it for sometime and
throws error:
the instruction I run is:
browser.goto(site_url)
C:/Ruby187/lib/ruby/1.8/timeout.rb:64:in rbuf_fill': execution expired (Timeout::Error) from ../lib/hands.rb:74:injoin’
from …/lib/hands.rb:74
from …/lib/hands.rb:72:in `each’
from …/lib/hands.rb:72
Are you sure this is the browser timing out and not the thread? I’ve
never used threads before…
It might be possible to trap the error within your browser.goto and hand
it back to the join statement without that error?
Are you sure this is the browser timing out and not the thread? I’ve
never used threads before…
It might be possible to trap the error within your browser.goto and hand
it back to the join statement without that error?
No-no, I went to this link, it catches the error, but the thing is I
dont want to catch the error, rather I want to go to the origin of the
error, and find why this is happening. What is happenning to that
thread? I mean ‘t’ any guess? or possible explanantions?
I don’t know enough about threads to be much help; but I would have
thought that if you’ve handled the error caused by the browser timing
out, then you’re passing another error back from that thread which is
causing a second exception.
If you want to include a backtrace in your error handling then that’s
simple enough:
I don’t know enough about threads to be much help; but I would have
thought that if you’ve handled the error caused by the browser timing
out, then you’re passing another error back from that thread which is
causing a second exception.
but then why am getting error at ‘join’
Something happened with that particular thread.
If you want to include a backtrace in your error handling then that’s
simple enough:
You’re using Ruby 1.8.7? I think I’ve seen a few comments online about
thread timeout handling being buggy in that version.
Try a separate install on 1.9.3 and see if the problem still exists.
You should also read up on handling errors both inside the threads, and
in the parent process. For example:
If an exception is raised in the main thread, and is not handled
anywhere, the Ruby interpreter prints a message and exits. In threads
other than the main thread, unhandled exceptions cause the thread to
stop running.
If a thread t exits because of an unhandled exception, and another
thread s calls t.join or t.value, then the exception that occurred in t
is raised in the thread s.
If Thread.abort_on_exception is false, the default condition, an
unhandled exception simply kills the current thread and all the rest
continue to run.
If you would like any unhandled exception in any thread to cause the
interpreter to exit, set the class method Thread.abort_on_exception to
true.t = Thread.new { … }
t.abort_on_exception = true
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.