Browse Source

- bug fix #1386

cl-refactor
yann300 10 years ago
parent
commit
c17edbff0a
  1. 15
      mix/ClientModel.cpp
  2. 4
      mix/qml/StatusPane.qml

15
mix/ClientModel.cpp

@ -242,7 +242,12 @@ void ClientModel::executeSequence(std::vector<TransactionSettings> const& _seque
break; break;
} }
if (!f) if (!f)
BOOST_THROW_EXCEPTION(FunctionNotFoundException() << FunctionName(transaction.functionId.toStdString())); {
emit runFailed("Function '" + transaction.functionId + tr("' not found. Please check transactions or the contract code."));
m_running = false;
emit runStateChanged();
return;
}
if (!transaction.functionId.isEmpty()) if (!transaction.functionId.isEmpty())
encoder.encode(f); encoder.encode(f);
for (QVariableDeclaration const* p: f->parametersList()) for (QVariableDeclaration const* p: f->parametersList())
@ -269,7 +274,12 @@ void ClientModel::executeSequence(std::vector<TransactionSettings> const& _seque
{ {
auto contractAddressIter = m_contractAddresses.find(transaction.contractId); auto contractAddressIter = m_contractAddresses.find(transaction.contractId);
if (contractAddressIter == m_contractAddresses.end()) if (contractAddressIter == m_contractAddresses.end())
BOOST_THROW_EXCEPTION(dev::Exception() << dev::errinfo_comment("Contract not deployed: " + transaction.contractId.toStdString())); {
emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId);
m_running = false;
emit runStateChanged();
return;
}
callContract(contractAddressIter->second, encoder.encodedData(), transaction); callContract(contractAddressIter->second, encoder.encodedData(), transaction);
} }
} }
@ -283,7 +293,6 @@ void ClientModel::executeSequence(std::vector<TransactionSettings> const& _seque
std::cerr << boost::current_exception_diagnostic_information(); std::cerr << boost::current_exception_diagnostic_information();
emit runFailed(QString::fromStdString(boost::current_exception_diagnostic_information())); emit runFailed(QString::fromStdString(boost::current_exception_diagnostic_information()));
} }
catch(std::exception const& e) catch(std::exception const& e)
{ {
std::cerr << boost::current_exception_diagnostic_information(); std::cerr << boost::current_exception_diagnostic_information();

4
mix/qml/StatusPane.qml

@ -76,9 +76,9 @@ Rectangle {
function format(_message) function format(_message)
{ {
var formatted = _message.match(/(?:<dev::eth::)(.+)(?:>)/); var formatted = _message.match(/(?:<dev::eth::)(.+)(?:>)/);
if (formatted === null) if (formatted)
formatted = _message.match(/(?:<dev::)(.+)(?:>)/); formatted = _message.match(/(?:<dev::)(.+)(?:>)/);
if (formatted.length > 1) if (formatted && formatted.length > 1)
formatted = formatted[1]; formatted = formatted[1];
else else
return _message; return _message;

Loading…
Cancel
Save