Thanks.
I'm satisfied with just logging all warnings...so I can fix them during
development and always track them in my custom log on production since I
don't have access to php error log on my shared hosting :)
Regards,
Saša Stamenković
On Tue, Sep 29, 2009 at 9:56 AM, drm wrote:
> Hi Saša,
>
Hi Saša,
Basically, if the exception isn't thrown within the dispatch loop, you
would have to catch the exception in your index.php and dispatch to your
error controller yourself. To make sure your errors and notices etc are
thrown as exceptions you would need an error handler like mine.
Ro
Man, this really works. Thanks :)
Regards,
Saša Stamenković
On Mon, Sep 28, 2009 at 2:03 PM, Karol Grecki wrote:
>
> You need to check that in order to ignore suppressed errors. I gave you
> working code that does exactly what you want. I suggest you use it. You can
> always change it later on
You need to check that in order to ignore suppressed errors. I gave you
working code that does exactly what you want. I suggest you use it. You can
always change it later once you understand how it works.
Karol
umpirsky wrote:
>
> But I want to catch errors that are not suppressed with @. If I
But I want to catch errors that are not suppressed with @. If I check if
error reporting is on, I will catch all of them or no one.
Regards,
Saša Stamenković
On Mon, Sep 28, 2009 at 1:36 PM, Karol Grecki wrote:
>
> There's answer for it in the code sample I gave you.
> Error handler will inter
There's answer for it in the code sample I gave you.
Error handler will intercept all errors even if they were silenced with @
operator.
You need to check if error reporting is disabled at the time the error
happens.
Karol
umpirsky wrote:
>
> Now I get a lot of crap catched :)
> For example:
>
Now I get a lot of crap catched :)
For example:
fopen(/mnt/home/sasas/www/auto/application/controllers/ImagesController.php)
[function.fopen]: failed to open stream: No
such file or directory in /mnt/home/sasas/www/Zend/Loader.php #165.
which is ok, but this:
fopen(/mnt/home/sasas/www/auto/appli
Nice answer Grecki, thanks.
require_once 'controllers/ErrorController.php';
set_error_handler(array('ErrorController', 'phpError'));
fixed problem. Strange :)
Regards,
Saša Stamenković
On Mon, Sep 28, 2009 at 1:03 PM, Karol Grecki wrote:
>
> If you named your functions differently you need to
If you named your functions differently you need to modify the code
accordingly.
Also, make sure that this class is actually loaded or can be loaded with
autoloader before you try to use it and register the error handler.
Regards
Karol
umpirsky wrote:
>
> *Warning*: set_error_handler() expect
No, I have phpError static method
in ErrorController, set_error_handler(array('ErrorController', 'phpError'));
calls it staticly, not through MVC, right?
Regards,
Saša Stamenković
On Mon, Sep 28, 2009 at 12:57 PM, till wrote:
> On Mon, Sep 28, 2009 at 12:54 PM, Саша Стаменковић
> wrote:
> > W
On Mon, Sep 28, 2009 at 12:54 PM, Саша Стаменковић wrote:
> Warning: set_error_handler() expects the argument
> (ErrorController::phpError) to be a valid callback in
> /mnt/home/sasas/www/auto/application/Bootstrap.php on line 16
You probably need phpErrorAction() ?
Till
*Warning*: set_error_handler() expects the argument
(ErrorController::phpError) to be a valid callback in *
/mnt/home/sasas/www/auto/application/Bootstrap.php* on line *16*
Regards,
Saša Stamenković
On Mon, Sep 28, 2009 at 12:29 PM, Karol Grecki wrote:
>
> Try this, it works for me.
>
> class
Try this, it works for me.
class X_Error_Handler
{
public static function handle($errno, $errstr, $errfile, $errline)
{
//this allows error suppression in 3rd party code to work
if (!error_reporting()) return;
throw new X_RuntimeException($errstr . " in $errfile:$
Thx. But I can't see how this can help :P
Regards,
Saša Stamenković
On Thu, Sep 24, 2009 at 3:00 PM, Vincent de Lau wrote:
> > What i did was writing a function that simply throws an exception and
> > passing that function to set_error_handler, something like this:
> >
> > error_reporting(E_AL
> What i did was writing a function that simply throws an exception and
> passing that function to set_error_handler, something like this:
>
> error_reporting(E_ALL);
> function exceptionThrower($type, $errMsg, $errFile, $errLine) {
> throw new Exception($errMsg);
> }
> set_error_handler('exce
Thx, thats ok, but is there any way to trap error in ErrorController, maybe
redirect to /error, but then you need to pass error msg through url...messy
:)
Regards,
Saša Stamenković
On Thu, Sep 24, 2009 at 2:33 PM, drm wrote:
> Hi,
>
> What i did was writing a function that simply throws an exc
Hi,
What i did was writing a function that simply throws an exception and
passing that function to set_error_handler, something like this:
error_reporting(E_ALL);
function exceptionThrower($type, $errMsg, $errFile, $errLine) {
throw new Exception($errMsg);
}
set_error_handler('exceptionThro
I'm trying to do this with set_error_handler(), my will is to trigger Error
controller and catch this as application error, since I want to log all
errors in one place - Error controller.
I tried with setting error handler in bootstrap to function in index.php and
that function calls error contr
I'm trying to do this with set_error_handler(), my will is to trigger Error
controller and catch this as application error, since I want to log all
errors in one place - Error controller.
I tried with setting error handler in bootstrap to function in index.php and
that function calls error controll
19 matches
Mail list logo