Skip to content

Commit 4e90403

Browse files
SND\joelleach_cpSND\joelleach_cp
authored andcommitted
ParallelFox: Added default error handler for workers when not in debug mode to prevent crashes.
git-svn-id: https://vfpx.svn.codeplex.com/svn/ParallelFox@94126 81e6e737-5a20-4d0f-a97c-cb01297b46e0
1 parent 4a307dc commit 4e90403

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

workermgr.VCT

1.59 KB
Binary file not shown.

workermgr.vca

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,51 @@ PLATFORM C(8,0),UNIQUEID C(10,0),TIMESTAMP N(10,0),CLASS M(4,0),CLASSLOC M(4,0),
88
[START RESERVED1]
99
VERSION = 3.00[END RESERVED1]
1010

11+
[ RECORD]
12+
[PLATFORM] WINDOWS
13+
[UNIQUEID] _3CV0I1GR4
14+
[CLASS] custom
15+
[BASECLASS] custom
16+
[OBJNAME] errorhandler
17+
[START PROPERTIES]
18+
Name = "errorhandler"
19+
_memberdata = <VFPData><memberdata name="handleerror" display="HandleError"/></VFPData>
20+
[END PROPERTIES]
21+
[START METHODS]
22+
PROCEDURE Init
23+
* Default error handler
24+
* Unhandled errors may cause workers to crash when not in debug mode
25+
26+
On Error _Screen.oErrorHandler.HandleError(Error(), Sys(16), Lineno(1), Message(), Message(1))
27+
ENDPROC
28+
PROCEDURE handleerror
29+
* Handle worker error and return to main process
30+
Lparameters lnError, lcMethod, lnLine, lcMessage, lcCode
31+
Local Worker as Worker
32+
Worker = NewObject("Worker", "ParallelFox.vcx")
33+
34+
Worker.ReturnError(lnError, lcMethod, lnLine, lcMessage, lcCode)
35+
36+
* Exit current code containing error and return to command processor
37+
Return to ProcessCommand
38+
ENDPROC
39+
[END METHODS]
40+
[START RESERVED1]
41+
Class[END RESERVED1]
42+
[START RESERVED2]
43+
1[END RESERVED2]
44+
[START RESERVED3]
45+
*handleerror Handle worker error.
46+
_memberdata XML Metadata for customizable properties
47+
[END RESERVED3]
48+
[START RESERVED6]
49+
Pixels[END RESERVED6]
50+
51+
[ RECORD]
52+
[PLATFORM] COMMENT
53+
[UNIQUEID] RESERVED
54+
[OBJNAME] errorhandler
55+
1156
[ RECORD]
1257
[PLATFORM] WINDOWS
1358
[UNIQUEID] _2Z619GLX6
@@ -104,6 +149,8 @@ _VFP.Caption = "ParallelFox Worker"
104149
* can cause worker to crash.
105150
If _VFP.StartMode > 1
106151
Sys(2335,0)
152+
* Default error handler
153+
_Screen.NewObject("oErrorHandler", "ErrorHandler", "ParallelFox.vcx")
107154
EndIf
108155
Set TablePrompt Off
109156
This.oCmdTimer = NewObject("tmrCommand", "ParallelFox.vcx")

workermgr.vcx

218 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)