Re: RecordNotFound



aaah! Thanks a lot!

Michael Gorsuch schrieb:
Try using Ruby's exception handling:

begin
@new_ipv4 = Ipv4addr.find(IPAddr.new(params[:ipv4addr][:id]).to_i)
rescue
# Code to add data to database
end

A little more info:

http://www.rubycentral.com/book/tut_exceptions.html

On 3/16/06, Franz Bettag <fbettag@xxxxxxxxxxxxxx> wrote:

Hi guys,

uhm how to fetch out a RecordNotFound?

i have this here

@new_ipv4 = Ipv4addr.find(IPAddr.new(params[:ipv4addr][:id]).to_i)

but at this line it gives an error RecordNotFound. But this is okay! But
now i want the application to do something special like adding the not
found IPaddr to the database.. But how? since it stops at this line =)

Thanks in advance!
--


Mit freundlichen Grüßen

Franz Bettag

____________________________
QS Housing
Franz Bettag
Ludwigstr. 45-47
90402 Nürnberg
http://www.qs-housing.net

Tel: +49 1805 737376 664
Fax: +49 1805 737376 665






--


Mit freundlichen Grüßen

Franz Bettag

____________________________
QS Housing
Franz Bettag
Ludwigstr. 45-47
90402 Nürnberg
http://www.qs-housing.net

Tel: +49 1805 737376 664
Fax: +49 1805 737376 665
.



Relevant Pages

  • Problem with SSH
    ... I want to scp from the old one with scp and a rsa-key to the new one. ... Franz Bettag ... QS Housing ... Ludwigstr. ...
    (comp.security.ssh)
  • Re: Case issue with ASP <%=Request("")%> code
    ... The drop down is from the database. ... I would suspect then that it ... should return "Housing", not housing. ... >> I have an ASP page that lists projects by type. ...
    (microsoft.public.frontpage.client)
  • One to one relationship?
    ... It is all to do with sites for housing developments. ... site will have a part of it set aside for affordable housing. ... And this affordable housing element will ... what implications will it have for my database as I hear that such ...
    (microsoft.public.access.tablesdbdesign)
  • HELP! Renamed a computer with oracle xe
    ... Im having a bit of a problem, we renamed our server that is housing ... oracle XE and a website... ... Now it cannot find the database! ...
    (comp.databases.oracle.server)
  • date - # of days calcuation
    ... The problem is I need to figure out how many days we supplied overnight ... housing for people for the month of JUNE only. ... or should I redesign the database to put some other field in there? ... Prev by Date: ...
    (microsoft.public.access.queries)