[FX.php List] Catch FileMaker Server before it dies?
Andrew Denman
adenman at tmea.org
Fri May 25 13:25:12 MDT 2012
No, it's a snippet I stole from the page I could open the quickest. In this particular case the code above the provided snippet sets up a find request. I included only the last line so you could see where the $Data variable came from. $Setup is the FX.php object.
I use this check, or a variation depending on page flow, after each database request to check for errors. It can be any type of request (new, edit, find, findall).
Andrew Denman
From: fx.php_list-bounces at mail.iviking.org [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Denis Somar
Sent: Friday, May 25, 2012 1:28 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Catch FileMaker Server before it dies?
Is that script effectively running a FindAll step?
On Fri, May 25, 2012 at 2:12 PM, Andrew Denman <adenman at tmea.org<mailto:adenman at tmea.org>> wrote:
Here's my error checking block that handles FileMaker errors and FX.php errors (when FileMaker server isn't responding or something goes wrong with the XML), based off instructions Chris provided in the past.
// Find them!
$Data = $Setup->FMFind();
// See if there's an error
if(FX::isError($Data) || $Data['errorCode'] != 0 ){
// Display for FX.php error
if(FX::isError($Data)){
$error = "The server may be down.<br>";
$error .= $Data->getMessage();
// Display for FileMaker error
}else{
require_once('\FX\FMErrors.php');
//$errorsList is error array name
$error = $errorsList[$Data['errorCode']];
}
}else{
// Everything OK, process data
} // END FM error
Andrew Denman
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org<mailto:fx.php_list-bounces at mail.iviking.org> [mailto:fx.php_list-bounces at mail.iviking.org<mailto:fx.php_list-bounces at mail.iviking.org>] On Behalf Of Bob Patin
Sent: Thursday, May 24, 2012 4:12 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Catch FileMaker Server before it dies?
I have a little script I use that will send me an error message if a web server's WPE isn't responding; what I do is to use a test database that has a few records; if the WPE doesn't respond in a reasonable amount of seconds, I get an SMS and an email warning me that there was an issue. I use a robot machine (that does other robot duties too) to run this script every 3 minutes.
You could write some sort of script to do a simple find; if it doesn't return an error-free response, you could direct users to an error page. However, if the WPE geeks completely, you're not going to get a FileMaker error back, and perhaps Chris could tell you what sort of IF statement to write to catch that situation.
Bob Patin
Longterm Solutions LLC
bob at longtermsolutions.com<mailto:bob at longtermsolutions.com>
615-333-6858<tel:615-333-6858>
http://www.longtermsolutions.com
FileMaker 9, 10 & 11 Certified Developer Member of FileMaker Business Alliance and FileMaker TechNet
--
Twitter: bobpatin
Google+: http://www.longtermsolutions.com/plus
AIM: longterm1954
iChat: bobpatin
--
Expert FileMaker Consulting
FileMaker Hosting for all versions of FileMaker
On May 24, 2012, at 2:26 PM, Denis Somar wrote:
> Hi all,
>
> I'm about to go into beta testing with my first production-worthy FMP web project. I'm not sure of the load to expect (nothing huge initially) in terms of users, but I'm wondering if I can catch catch automatically when the site is under a heavy load so I know that it happens. Are there any PHP calls that can be used to die gracefully (or not) and just say the database server isn't working/isn't responding.
>
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org<mailto:FX.php_List at mail.iviking.org>
http://www.iviking.org/mailman/listinfo/fx.php_list
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org<mailto:FX.php_List at mail.iviking.org>
http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120525/8b814e7d/attachment-0001.html
More information about the FX.php_List
mailing list