Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-4084

Error messages reported via raiseError() should be preserved

    XMLWordPrintable

    Details

    • Branch:
    • QA Testing:
      Graph automated test
    • QA Test Identification:
      CTL_raiseError_CLO-4084.grf

      Description

      Our customers often use raiseError for error handling and the common usage pattern is similar to this (this requires Reformat with two connected ports - second port is the error port):

      //#CTL2
      
      function integer transform() {
      	// Some code here...
      
      	if (error) {
      		reportError("Unable to find column header for column " + col);
      	}
      
      	return OK;
      }
      
      function integer transformOnError(string errorMessage, string stackTrace) {
      	$out.1.ErrorMessage = errorMessage;
      	$out.1.StackTrace = stackTrace;
      	$out.1.Timestamp = today();
      	return 1;
      }
      

      The above code will produce the following errorMessage:

      Interpreter runtime exception on line 32 column 9
      Caused by: org.jetel.exception.JetelRuntimeException -> Exception raised by user: Unable to find group header for column 234
      ----------------------- CTL2 snippet -----------------------
      32:         raiseError("Unable to find group header for column " + col);
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ----------------------- CTL2 snippet -----------------------
      Call arguments: 
      [1] 

      By default, error messages are written to log file, database etc. Above message is nice, but the actual message is buried within the text.

      Please improve the transformOnError (and similar for other "main" methods) so that the error message would be passed in the clear. For example, change the signature to:
      function integer transformOnError(string errorMessage, string errorText, string stackTrace).
      The errorText would contain the text of the error message without all the stuff Clover adds to it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              krivanekm Milan Krivanek
              Reporter:
              repcekb Branislav Repcek
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 hour Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours
                  6h