Upload a notebook to Evernote
| 465 | |
| 466 | // Upload a notebook to Evernote |
| 467 | qint32 CommunicationManager::uploadNotebook(Notebook ¬ebook) { |
| 468 | try { |
| 469 | if (notebook.updateSequenceNum > 0) |
| 470 | return myNoteStore->updateNotebook(notebook, authToken); |
| 471 | else { |
| 472 | notebook = myNoteStore->createNotebook(notebook, authToken); |
| 473 | return notebook.updateSequenceNum; |
| 474 | } |
| 475 | } catch (ThriftException e) { |
| 476 | QLOG_ERROR() << "ThriftException:"; |
| 477 | QLOG_ERROR() << "Exception Type:" << e.type(); |
| 478 | QLOG_ERROR() << "Exception Msg:" << e.what(); |
| 479 | error.type = CommunicationError::ThriftException; |
| 480 | error.message = errorWhat(e.what()); |
| 481 | DebugTool d; |
| 482 | d.dumpNotebook(notebook); |
| 483 | return 0; |
| 484 | } catch (EDAMUserException e) { |
| 485 | QLOG_ERROR() << "EDAMUserException:" << e.errorCode << endl; |
| 486 | error.code = e.errorCode; |
| 487 | error.type = CommunicationError::EDAMUserException; |
| 488 | error.message = errorWhat(e.what()); |
| 489 | DebugTool d; |
| 490 | d.dumpNotebook(notebook); |
| 491 | return 0; |
| 492 | } catch (EDAMSystemException e) { |
| 493 | QLOG_ERROR() << "EDAMSystemException"; |
| 494 | handleEDAMSystemException(e); |
| 495 | DebugTool d; |
| 496 | d.dumpNotebook(notebook); |
| 497 | return 0; |
| 498 | } catch (EDAMNotFoundException e) { |
| 499 | QLOG_ERROR() << "EDAMNotFoundException"; |
| 500 | DebugTool d; |
| 501 | d.dumpNotebook(notebook); |
| 502 | handleEDAMNotFoundException(e); |
| 503 | return false; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | |
| 508 | // Permanently delete a notebook from Evernote |
no test coverage detected