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

HASHDECL-IMPLICIT-CONSTRUCTION-ERROR in the Smtp module #3813

Closed
turlyalz opened this issue Mar 5, 2020 · 0 comments
Closed

HASHDECL-IMPLICIT-CONSTRUCTION-ERROR in the Smtp module #3813

turlyalz opened this issue Mar 5, 2020 · 0 comments

Comments

@turlyalz
Copy link
Contributor

turlyalz commented Mar 5, 2020

2020.03.04 02:44:36.387279 T12: ID 3: WI 5: BasicsSendEmailToUser(4/0): System exception: /opt/share/qore-modules/0.9.4.1/SmtpClient.qm:851 (Qore): HASHDECL-IMPLICIT-CONSTRUCTION-ERROR: cannot implicitly create typed hash 'SmtpResponseInfo' with an assignment; to address this error, declare the typed hash before the assignment
  *** RETHROW at /opt/share/qore-modules/0.9.4.1/SmtpClient.qm:522 (Qore)
  SmtpClient::sendMessageInfoIntern() called at /opt/share/qore-modules/0.9.4.1/SmtpClient.qm:506 (Qore user code)
  SmtpClient::sendMessage() called at BasicsSendEmailToUser:22 (Qore source "/opt/qorus/user/03_basics/01_exchange_rates_app/12_process_orders_workflow/qore/steps/BasicsSendEmailToUser-1.0.qstep":22 user code)
  BasicsSendEmailToUser::primary() called at <builtin>:-1 (Qore user code)
  call_object_method_args() called at Workflow.qc:222 (Qore builtin code)
  Workflow::runStepPrimaryArgs() called at WorkflowExecutionInstance.qc:2748 (Qore user code)
  WorkflowExecutionInstance::executeNormalStep() called at WorkflowExecutionInstance.qc:1565 (Qore user code)
  WorkflowExecutionInstance::execStep() called at WorkflowExecutionInstance.qc:1670 (Qore user code)
  WorkflowExecutionInstance::execStepThread() called at WorkflowExecutionInstance.qc:2028 (Qore user code)
  WorkflowExecutionInstance::execSegment() called at WorkflowExecutionInstance.qc:2058 (Qore user code)
  WorkflowExecutionInstance::execInitialSegment() called at WorkflowExecutionInstance.qc:1123 (Qore user code)
  WorkflowExecutionInstance::exec() called at WorkflowExecutionInstance.qc:268 (Qore user code)
  WorkflowExecutionInstance::startWorkflow() called at ClusterWorkflowExecutionInstance.qc:177 (Qore user code)
  ClusterWorkflowExecutionInstance::startWorkflow() called at WorkflowExecutionInstance.qc:200 (Qore user code)
  *** thread started by background operator ***

Step example:

%new-style
%strict-args
%require-types
%enable-all-warnings

%requires SmtpClient
%requires MailMessage

class BasicsSendEmailToUser inherits QorusNormalStep {
    primary() {
        list<hash<auto>> orders = getStaticData("orders");

        SmtpClient smtp = getUserConnection("smtp-email");

        foreach hash<auto> order in (orders) {
            log(LL_DEBUG_1, "Sending email to %s", order.user_email);

            MailMessage::Message message("test.qorus@gmail.com", "Order details");
            string text = sprintf("You have received %d %s", order.amount, order.currency_to_buy);
            message.setBody(text);
            message.addTO(order.user_email);
            smtp.sendMessage(message);
        }
    }
}
turlyalz added a commit that referenced this issue Mar 6, 2020
@turlyalz turlyalz closed this as completed Mar 6, 2020
davidnich added a commit that referenced this issue Mar 6, 2020
* refs #3813 fixed type errors in SmtpClient

* refs #3018 fixed type
@davidnich davidnich added the fixed label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants