Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TripodException failing to report underlying error #50

Open
kiyanwang opened this issue Apr 28, 2015 · 0 comments
Open

TripodException failing to report underlying error #50

kiyanwang opened this issue Apr 28, 2015 · 0 comments
Labels

Comments

@kiyanwang
Copy link
Member

Last week I was debugging a migration script on one of the tarl jobs boxes. The script was dying without reporting any errors. I worked out that it was failling when making a call to tripod but couldnt understand why a Fatal error wasnt being reported so I added a Try catch around the call to a tripod method i.e.

try {
  ...
} catch (Exception $e) {
   echo $e->getMessage();
   echo $e->getTraceAsString();
}

The exception was caught but I got an error stating that $e has no method getMessage() or getTraceAsString(). On the other hand if I simply called

var_dump($e);

It confirmed that $e was a TripodException and within its properties I was able to figure out why my code had been failing (unable to connnect to MongoLab due to firewall restrictions) but what worried me was why the standard methods on Exception were not available when TripodException is defined as:

<?php
  class TripodException extends Exception {}

Btw I did try catching it as a TripodException and the results were the same.

@kiyanwang kiyanwang added the bug label Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant