Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

How can I mark a message as errored

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I mark a message as errored

    is there any way using javascript to flag the message as errored so that the error count increments in the dashboard?

  • #2
    Re:How can I mark a message as errored

    You should be able to just throw an exception from JavaScript and the channel will catch that and set the error state.
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment


    • #3
      Re:How can I mark a message as errored

      Excellent, thanks.

      Comment


      • #4
        Code Example for throwing an error that Mirth will log

        Originally posted by jbartels View Post
        You should be able to just throw an exception from JavaScript and the channel will catch that and set the error state.
        i.e.

        One way to customize errors that will be logged and shown on the dashboard properly in Mirth:

        Code:
        throw new Packages.java.lang.Exception("Put your custom error " +
                "string/code here.");
        Plus there are subclass exceptions you could also throw if you have multiple error conditions and want to be a bit more descriptive for each error type.

        List of known subclasses of error types are here:
        http://download.oracle.com/javase/6/docs/api/
        Jimmy
        - Denver, Colorado

        Comment


        • #5
          Error Message

          Hi,
          You can create channel for maintaining error log for this use try catch for handling exception in code when you get exception, then you just send that error message to another channel using "router.routeMessage('ChannelName', ErrorMessage)". Error Message should be in xml form.

          Comment


          • #6
            Originally posted by manish.zope View Post
            Hi,
            You can create channel for maintaining error log for this use try catch for handling exception in code when you get exception, then you just send that error message to another channel using "router.routeMessage('ChannelName', ErrorMessage)". Error Message should be in xml form.
            Thanks! This is helpful.
            Jimmy
            - Denver, Colorado

            Comment


            • #7
              I've tried to catch the error with "throw" in a javascript reader connector in Mirth 2.1.1 but it doesn't work

              Code:
              try {
              	var resultat = Packages.cat.trueta.GironaSftpReader.read(host,port, user, passwd, 10000,filename,path,delete);
              	return resultat;
              
              }
              catch(exp) {
                      [highlight]
              	throw "missatge error";
                      [/highlight]
              }
              The error counter doesn't get incremented and the server log shows these errors:

              Code:
              [2011-10-20 15:06:55,933]  ERROR (com.mirth.connect.connectors.js.JavaScriptMessageReceiver:145): org.mozilla.javascript.JavaScriptException: missatge error (bb5ded74-e56f-46d6-914f-64686a5b4e48#10)
              [2011-10-20 15:06:56,006]  FATAL (org.mule.impl.DefaultComponentExceptionStrategy:83): The Default Component Exception Strategy has been invoked but there is no current event on the context
              [2011-10-20 15:06:56,007]  FATAL (org.mule.impl.DefaultComponentExceptionStrategy:84): The error is: null
              java.lang.NullPointerException
              I've also tried metropath sugegstion of using "throw new Packages.java.lang.Exception(..." but with the same result


              any idea?

              carles massallé

              Comment

              Working...
              X