-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fatal errors – am I doing something wrong? #24
Comments
Mind catching the EDAMSystemException and printing out the |
I've added some logging and will let you know what I find. I'll also be doing the same for other exceptions that the following code is generating: $client = new \Evernote\Client($connection['credentials_token'], false);
$note = $client->getNote($payload['guid']);
$notebook = $client->getNotebook($payload['notebookGuid']); Here are some traces: // backtrace 1
Vendor/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php:717 in EDAM\UserStore\UserStore_getNoteStoreUrl_result::read
Vendor/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php:678 in EDAM\UserStore\UserStoreClient::recv_getNoteStoreUrl
: in EDAM\UserStore\UserStoreClient::getNoteStoreUrl
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Store/Store.php:25 in ReflectionMethod::invokeArgs
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/AdvancedClient.php:59 in Evernote\Store\Store::__call
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/AdvancedClient.php:59 in Evernote\Store\Store::getNoteStoreUrl
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:376 in Evernote\AdvancedClient::getNoteStore
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:616 in Evernote\Client::getUserNotestore
app/Plugin/Evernote/Controller/EvernoteImportController.php:65 in Evernote\Client::getNote
app/Plugin/Evernote/Controller/EvernoteImportController.php:20 in EvernoteImportController::__getNoteDetails
: in EvernoteImportController::webhook
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Controller/Controller.php:490 in ReflectionMethod::invokeArgs
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Routing/Dispatcher.php:193 in Controller::invokeAction
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Routing/Dispatcher.php:167 in Dispatcher::_invoke
app/webroot/index.php:99 in Dispatcher::dispatch
// backtrace 2
Vendor/evernote/evernote-cloud-sdk-php/src/EDAM/NoteStore/NoteStore.php:4355 in EDAM\NoteStore\NoteStore_getSharedNotebookByAuth_result::read
Vendor/evernote/evernote-cloud-sdk-php/src/EDAM/NoteStore/NoteStore.php:4316 in EDAM\NoteStore\NoteStoreClient::recv_getSharedNotebookByAuth
: in EDAM\NoteStore\NoteStoreClient::getSharedNotebookByAuth
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Store/Store.php:25 in ReflectionMethod::invokeArgs
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:908 in Evernote\Store\Store::__call
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:908 in Evernote\Store\Store::getSharedNotebookByAuth
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:694 in Evernote\Client::getNoteBookByLinkedNotebook
app/Plugin/Evernote/Controller/EvernoteImportController.php:66 in Evernote\Client::getNotebook
app/Plugin/Evernote/Controller/EvernoteImportController.php:20 in EvernoteImportController::__getNoteDetails
: in EvernoteImportController::webhook
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Controller/Controller.php:490 in ReflectionMethod::invokeArgs
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Routing/Dispatcher.php:193 in Controller::invokeAction
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Routing/Dispatcher.php:167 in Dispatcher::_invoke
// backtrace 3:
Vendor/evernote/evernote-cloud-sdk-php/src/EDAM/NoteStore/NoteStore.php:4295 in EDAM\NoteStore\NoteStore_authenticateToSharedNotebook_result::read
Vendor/evernote/evernote-cloud-sdk-php/src/EDAM/NoteStore/NoteStore.php:4255 in EDAM\NoteStore\NoteStoreClient::recv_authenticateToSharedNotebook
: in EDAM\NoteStore\NoteStoreClient::authenticateToSharedNotebook
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Store/Store.php:25 in ReflectionMethod::invokeArgs
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:901 in Evernote\Store\Store::__call
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:901 in Evernote\Store\Store::authenticateToSharedNotebook
Vendor/evernote/evernote-cloud-sdk-php/src/Evernote/Client.php:639 in Evernote\Client::getSharedNotebookAuthResult
app/Plugin/Evernote/Controller/EvernoteImportController.php:65 in Evernote\Client::getNote
app/Plugin/Evernote/Controller/EvernoteImportController.php:20 in EvernoteImportController::__getNoteDetails
: in EvernoteImportController::webhook
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Controller/Controller.php:490 in ReflectionMethod::invokeArgs
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Routing/Dispatcher.php:193 in Controller::invokeAction
Vendor/pear-pear.cakephp.org/CakePHP/Cake/Routing/Dispatcher.php:167 in Dispatcher::_invoke
app/webroot/index.php:99 in Dispatcher::dispatch |
I'm having trouble chasing this down. My current code looks like: $client = new \Evernote\Client($connection['credentials_token'], false);
$advancedClient = $client->getAdvancedClient();
try {
$userStore = $advancedClient->getUserStore();
} catch (EDAM\Error\EDAMSystemException $e) {
$error = '';
$error .= 'EDAM\Error\EDAMSystemException errorCode::'.$e->errorCode;
$error .= 'EDAM\Error\EDAMSystemException message::'.$e->message;
throw new Exception($error);
} Based on the errors I'm getting, I might not be catching them right? Any help would be greatly appreciated. PHP Fatal error: Uncaught exception 'EDAM\Error\EDAMSystemException' in /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php:2611
Stack trace:
#0 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php(543): EDAM\UserStore\UserStore_getUser_result->read(Object(Thrift\Protocol\TBinaryProtocol))
#1 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php(504): EDAM\UserStore\UserStoreClient->recv_getUser()
#2 [internal function]: EDAM\UserStore\UserStoreClient->getUser('S=s367:U=3c7c31...')
#3 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/Evernote/Store/Store.php(50): call_user_func_array(Array, Array)
#4 /mnt/task/lib/whatsup-evernote/EvernoteModel.php(38): Evernote\Store\Store->__call('getUser', Array)
#5 /mnt/task/lib/whatsup-evernote/EvernoteModel.php(38): Evernote\Store\Store->getUser()
#6 /mnt/task/lib/whatsup/WhatsUp.php(131): EvernoteModel->process(Array, '9c151f51b95ef39...') I'm also seeing these Exceptions: Fatal error: Uncaught exception 'Thrift\Exception\TTransportException' with message 'THttpClient: Could not connect to www.evernote.com:443//edam/user' in /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/Thrift/Transport/THttpClient.php:213
Stack trace:
#0 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php(521): Thrift\Transport\THttpClient->flush()
#1 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php(503): EDAM\UserStore\UserStoreClient->send_getUser('S=s4:U=462a2:E=...')
#2 [internal function]: EDAM\UserStore\UserStoreClient->getUser('S=s4:U=462a2:E=...')
#3 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/Evernote/Store/Store.php(50): call_user_func_array(Array, Array)
#4 /mnt/task/lib/whatsup-evernote/EvernoteModel.php(38): Evernote\Store\Store->__call('getUser', Array)
#5 /mnt/task/lib/whatsup-evernote/EvernoteModel.php(38): Evernote\Store\Store->getUser()
#6 /mnt/task/lib/whatsup/WhatsUp.php(131): EvernoteModel->process(Array, 'ca8f5ef1a6d409e...')
#7 /mnt/t in /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/Thrift/Transport/THttpClient.php on line 213
PHP Fatal error: Uncaught exception 'Thrift\Exception\TTransportException' with message 'THttpClient: Could not connect to www.evernote.com:443//edam/user' in /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/Thrift/Transport/THttpClient.php:213
Stack trace:
#0 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php(521): Thrift\Transport\THttpClient->flush()
#1 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/EDAM/UserStore/UserStore.php(503): EDAM\UserStore\UserStoreClient->send_getUser('S=s4:U=462a2:E=...')
#2 [internal function]: EDAM\UserStore\UserStoreClient->getUser('S=s4:U=462a2:E=...')
#3 /mnt/task/lib/evernote/evernote-cloud-sdk-php/src/Evernote/Store/Store.php(50): call_user_func_array(Array, Array)
#4 /mnt/task/lib/whatsup-evernote/EvernoteModel.php(38): Evernote\Store\Store->__call('getUser', Array)
#5 /mnt/task/lib/whatsup-evernote/EvernoteModel.php(38): Evernote\Store\Store->getUser()
#6 /mnt/task/lib/whatsup/WhatsUp.php(131): EvernoteModel->process(Array, 'ca8f5ef1a6d409e...') |
Haven't done php in years so not sure how helpful I can be - do you need to import EDAM\Error\EDAMSystemException? Generally an EDAMSystemException means there's something's wrong in our service (vs an EDAMUserException or EDAMNotFoundException, where something's wrong on the client end) and the errorCode and parameter usually provide more info. For the TExceptions, that looks like a connectivity issue, your server was having trouble contacting our service. Either the network was down or our service was down (rare, but it happens) - I know we had a few minutes of downtime some time within the last two weeks. |
It may be easiest to catch Exception directly and try printing out $e->errorCode and $e->message? |
Using the latest tagged release, I have a check to verify the user's token is valid. I'm currently doing it like this:
This works well 99% of cases, but randomly it crashes with the error below. Is there perhaps something I'm doing wrong?
PS: If there's a better way to do this, I'm all ears!
The text was updated successfully, but these errors were encountered: