not catching my exception

J

Junkone

Hello
begin
if(nil|pattern.match(details)) then
id=$1
rec=Scans.find(id)
rec.scannable=MARKTRUE
rec.save
else
badpattern=true
end
rescue RecordNotFound
badpattern=true

end

I still get the prog stopping and printing out the exception
Pl choose alert action? 3 1000
e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/
dependencies.rb:266:in `load_missing_constant': uniniti
alized constant RecordNotFound (NameError)
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/
active_support/dependencies.rb:452:in `const_missing'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/
active_support/dependencies.rb:464:in `const_missing'
from MainMenu.rb:118:in `alertsMenu'
 
Y

yermej

Hello
begin
if(nil|pattern.match(details)) then
id=$1
rec=Scans.find(id)
rec.scannable=MARKTRUE
rec.save
else
badpattern=true
end
rescue RecordNotFound
badpattern=true

end

I still get the prog stopping and printing out the exception
Pl choose alert action? 3 1000

uninitialized constant RecordNotFound (NameError)

This is telling you that RecordNotFound has not been defined. Maybe
you've forgotten to include something?
 
J

Jean-François Trân

2008/1/16 said:
uninitialized constant RecordNotFound (NameError)

This is telling you that RecordNotFound has not been defined.
Maybe you've forgotten to include something?

I guess Junkone is refering to ActiveRecord::RecordNotFound
exception, but he doesn't give much info.

Furthermore, if it's a ActiveRecord related problem, it should be
asked in Rails-Talk mailing list.

-- Jean-Fran=E7ois.
 
J

Junkone

I guess Junkone is refering to ActiveRecord::RecordNotFound
exception, but he doesn't give much info.

Furthermore, if it's a ActiveRecord related problem,  it should be
asked in Rails-Talk mailing list.

   -- Jean-François.yes nol

now i realise i should have used ActiveRecord::RecordNotFound
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top