Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/kmymoneyutils.cpp
Context not available. | |||||
318 | { | 318 | { | ||
---|---|---|---|---|---|
319 | try { | 319 | try { | ||
320 | MyMoneyForecast::calculateAutoLoan(schedule, transaction, balances); | 320 | MyMoneyForecast::calculateAutoLoan(schedule, transaction, balances); | ||
321 | } catch (const MyMoneyException &e) { | 321 | } catch (const std::exception &e) { | ||
322 | KMessageBox::detailedError(0, i18n("Unable to load schedule details"), e.what()); | 322 | KMessageBox::detailedError(0, i18n("Unable to load schedule details"), e.what()); | ||
323 | } | 323 | } | ||
324 | } | 324 | } | ||
Context not available. | |||||
469 | if (schedule.type() == eMyMoney::Schedule::Type::LoanPayment) { | 469 | if (schedule.type() == eMyMoney::Schedule::Type::LoanPayment) { | ||
470 | calculateAutoLoan(schedule, t, QMap<QString, MyMoneyMoney>()); | 470 | calculateAutoLoan(schedule, t, QMap<QString, MyMoneyMoney>()); | ||
471 | } | 471 | } | ||
472 | } catch (const MyMoneyException &e) { | 472 | } catch (const std::exception &e) { | ||
473 | qDebug("Unable to load schedule details for '%s' during transaction match: %s", qPrintable(schedule.name()), qPrintable(e.what())); | 473 | qDebug("Unable to load schedule details for '%s' during transaction match: %s", qPrintable(schedule.name()), qPrintable(e.what())); | ||
474 | } | 474 | } | ||
475 | 475 | | |||
Context not available. | |||||
550 | currency.setTradingSymbol("???"); | 550 | currency.setTradingSymbol("???"); | ||
551 | try { | 551 | try { | ||
552 | currency = file->security(transaction.commodity()); | 552 | currency = file->security(transaction.commodity()); | ||
553 | } catch (const MyMoneyException &) { | 553 | } catch (const std::exception &) { | ||
554 | } | 554 | } | ||
555 | } | 555 | } | ||
556 | 556 | | |||
Context not available. | |||||
622 | } | 622 | } | ||
623 | ft.commit(); | 623 | ft.commit(); | ||
624 | ft.restart(); | 624 | ft.restart(); | ||
625 | } catch (const MyMoneyException &) { | 625 | } catch (const std::exception &) { | ||
626 | qDebug("Cannot delete price"); | 626 | qDebug("Cannot delete price"); | ||
627 | return; | 627 | return; | ||
628 | } | 628 | } | ||
Context not available. | |||||
635 | else | 635 | else | ||
636 | file->removeSecurity(security); | 636 | file->removeSecurity(security); | ||
637 | ft.commit(); | 637 | ft.commit(); | ||
638 | } catch (const MyMoneyException &) { | 638 | } catch (const std::exception &) { | ||
639 | } | 639 | } | ||
640 | } | 640 | } | ||
641 | } | 641 | } | ||
Context not available. | |||||
707 | try { | 707 | try { | ||
708 | MyMoneyFile::instance()->payeeByName(newname); | 708 | MyMoneyFile::instance()->payeeByName(newname); | ||
709 | newname = QString::fromLatin1("%1 [%2]").arg(newnameBase).arg(++count); | 709 | newname = QString::fromLatin1("%1 [%2]").arg(newnameBase).arg(++count); | ||
710 | } catch (const MyMoneyException &) { | 710 | } catch (const std::exception &) { | ||
711 | break; | 711 | break; | ||
712 | } | 712 | } | ||
713 | } | 713 | } | ||
Context not available. | |||||
717 | MyMoneyFile::instance()->addPayee(p); | 717 | MyMoneyFile::instance()->addPayee(p); | ||
718 | id = p.id(); | 718 | id = p.id(); | ||
719 | ft.commit(); | 719 | ft.commit(); | ||
720 | } catch (const MyMoneyException &e) { | 720 | } catch (const std::exception &e) { | ||
721 | KMessageBox::detailedSorry(nullptr, i18n("Unable to add payee"), | 721 | KMessageBox::detailedSorry(nullptr, i18n("Unable to add payee"), e.what()); | ||
722 | i18n("%1 thrown in %2:%3", e.what(), e.file(), e.line())); | | |||
723 | doit = false; | 722 | doit = false; | ||
724 | } | 723 | } | ||
725 | } | 724 | } | ||
Context not available. | |||||
755 | try { | 754 | try { | ||
756 | MyMoneyFile::instance()->tagByName(newname); | 755 | MyMoneyFile::instance()->tagByName(newname); | ||
757 | newname = QString::fromLatin1("%1 [%2]").arg(newnameBase, ++count); | 756 | newname = QString::fromLatin1("%1 [%2]").arg(newnameBase, ++count); | ||
758 | } catch (const MyMoneyException &) { | 757 | } catch (const std::exception &) { | ||
759 | break; | 758 | break; | ||
760 | } | 759 | } | ||
761 | } | 760 | } | ||
Context not available. | |||||
765 | MyMoneyFile::instance()->addTag(ta); | 764 | MyMoneyFile::instance()->addTag(ta); | ||
766 | id = ta.id(); | 765 | id = ta.id(); | ||
767 | ft.commit(); | 766 | ft.commit(); | ||
768 | } catch (const MyMoneyException &e) { | 767 | } catch (const std::exception &e) { | ||
769 | KMessageBox::detailedSorry(nullptr, i18n("Unable to add tag"), | 768 | KMessageBox::detailedSorry(nullptr, i18n("Unable to add tag"), e.what()); | ||
770 | i18n("%1 thrown in %2:%3", e.what(), e.file(), e.line())); | | |||
771 | } | 769 | } | ||
772 | } | 770 | } | ||
773 | } | 771 | } | ||
Context not available. | |||||
782 | file->addInstitution(institution); | 780 | file->addInstitution(institution); | ||
783 | ft.commit(); | 781 | ft.commit(); | ||
784 | 782 | | |||
785 | } catch (const MyMoneyException &e) { | 783 | } catch (const std::exception &e) { | ||
786 | KMessageBox::information(nullptr, i18n("Cannot add institution: %1", e.what())); | 784 | KMessageBox::information(nullptr, i18n("Cannot add institution: %1", e.what())); | ||
787 | } | 785 | } | ||
788 | } | 786 | } | ||
Context not available. |