Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #3028
| From | Mathias <mathias.hakansson@consultec.se> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: ErrorBlock/Begin Sequence does not work |
| Date | 2012-02-22 23:43 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <25158772.6553.1329982987753.JavaMail.geo-discussion-forums@vbai14> (permalink) |
| References | <68bbdb31-5b52-413b-9fd2-0f422fa40b81@eb6g2000vbb.googlegroups.com> |
Hi Grzegorz,
how do you know that your errorhandler does not get called. In my eyes it looks like your errorhandler only calls the original errorhandler. Try to use an errorhandler like this:
function MyErrorHandler(oError, lLocalHandler)
if lLocalHandler
break oError
endif
return nil
and set it up like this:
bLastHandler := ErrorBlock({|oErr| MyErrorHandler(oErr,true) })
This works for me. When I open the database I specify the path. Try if this helps.
db := CreateInstance(symclass,sFile,DBSHARED,DBREADWRITE)
My recover statement looks like this:
recover using oLocal
ErrorBlock(bLastHandler)
do case
case oLocal:oscode == 2 // File missing. Create file
if MyCreateDB(oLocal)
db := CreateInstance(symclass,file,DBEXCLUSIVE,DBREADWRITE)
if !CreateIndex(db)
lerror := false
Eval(bLastHandler,oLocal)
db := CreateInstance(symclass,file,DBSHARED,DBREADWRITE)
else
db:Close()
db := CreateInstance(symclass,file,DBSHARED,DBREADWRITE)
lerror := false
endif
else // Create standard error
lerror := false
Eval(bLastHandler,oLocal) // Generate an ordinary error.
endif
case oLocal:oscode == 32 // File sharing error
InfoBox{,"Database check",;
"Tried to adjust database " + file + ", but failed due to a file sharing error!" + CrLf +;
ListStack()}:Show()
lerror := false
db := CreateInstance(symclass,file,DBSHARED,DBREADWRITE)
case oLocal:oscode == 5 // Access denied
InfoBox{,file,"Could not open " + file + ". File is write protected or privilegies are insufficient"}:Show()
lerror := false
case InList(oLocal:subcode,2035,2006) // fpt-file missing, or write protected. Corrupted
InfoBox{,file,oLocal:operation}:Show()
lerror := false
otherwise
lerror := false
if !Empty(oLocal:ArgNum) .and. (oLocal:ArgNum <= ALen(oLocal:Args))
sArg := AsString(oLocal:Args[oLocal:ArgNum])
wArgType := UsualType(oLocal:Args[oLocal:ArgNum])
endif
InfoBox{,"DBCheck error",file + CrLf + CrLf + sarg + Str(wargtype) + Symbol2String(oLocal:funcsym) +;
oLocal:operation + Str(oLocal:subcode) + oLocal:Subcodetext +;
Str(oLocal:oscode) + CrLf + ListStack()}:Show()
endcase
end sequence
/Mathias
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
ErrorBlock/Begin Sequence does not work Grzegorz Ramotowski <ramotny@tlen.pl> - 2012-02-21 01:32 -0800
Re: ErrorBlock/Begin Sequence does not work "Marc Verkade [Marti]" <marcatm@rti.nl> - 2012-02-21 11:12 +0100
Re: ErrorBlock/Begin Sequence does not work "Willie Moore" <williem@wmconsulting.com> - 2012-02-21 07:28 -0600
Re: ErrorBlock/Begin Sequence does not work Grzegorz Ramotowski <ramotny@tlen.pl> - 2012-02-21 08:06 -0800
Re: ErrorBlock/Begin Sequence does not work "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2012-02-23 11:14 +1100
Re: ErrorBlock/Begin Sequence does not work Mathias <mathias.hakansson@consultec.se> - 2012-02-22 23:43 -0800
csiph-web