[ABE.pm] first legitimate PHP question

Adriano Ferreira aferreira at shopzilla.com
Tue Aug 12 18:02:22 PDT 2008


On Tue, Aug 12, 2008 at 9:45 PM, Ricardo SIGNES
<perl.abe at rjbs.manxome.org> wrote:
>
> I have some code roughly in this form:
>
>  try {
>    print "about to try\n";
>    $x = y();
>    print "done trying\n";
>  } catch (Exception $e) {
>    print "caught exception\n";
>  }
>
> I see "about to try" but not "done trying" and this happens:
>
>  Catchable fatal error: Object of class stdClass could not be converted to
>  string in /Users/rjbs/code/projects/Rx/php/Rx.php on line 54

A wild guess: if the PHP developers worked their exception model based
on Java, it may be that this "catchable error" is a more generic thing
than an exception, like Java Throwable, and then maybe you should use

  } catch (Throwable $e) {
    print "caught exception\n";
  }

to get this too. Otherwise, it understand you don't want to handle
that here, and follows along.


> Why isn't that exception getting caught?
>
> This code is in git://git.codesimply.com/Rx
>
> --
> rjbs
> _______________________________________________
> ABE-pm mailing list
> ABE-pm at pm.org
> http://mail.pm.org/mailman/listinfo/abe-pm
>


More information about the ABE-pm mailing list