Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get VFP OLE Server to use error procedure
Message
From
06/05/1998 11:39:00
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00097111
Message ID:
00097365
Views:
24
>I'm not sure if it's even safe to launch MessageBox() from the server.

Really? Why?


>The server I'm working on hse to sit there 24x7 logging realtime data so it has to do all it can survive errors. I think you'll just have to seed conditional code around the parts that can error out to skip the rest of the processing. The Error method can set a nLastError property that could be tested after each line that can give you errors and conditionally return the error to the client. I don't really know of a way to rollback the entire callstack from inside the error method. There isn't really a MASTER to return to since you are just running the method the client requested. I've got code like this in my server.

I think you may be right here. It is unfortunate though. The last thing I want to do is test for an error every other line.

What I ended up doing was using 'try...except' handler in Delphi. Like this. It actually works pretty well.

try
      // Call the Method
      //
      s := oDataDll.GetARDataByDate(StartDate,EndDate);
    except  
      // Method was canceled
      //     
      on E: Exception do
      begin
        ShowMessage('An error occurred!');
        exit;
      end;
    end;


If the method in the server gets CANCELled, the 'on E' code fires and I probably can write some code that explains a bit more about what had happened.

This has been an experience. Thanks to all you guys for all your help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform