Is it possible to get more precise errors from the API?

Hello SDL Developers,

let me give you some background on my request:

We are very often faced with problems that users have, when they work with our connector to SDL Studio.

Our connector shows to the user any exceptions which we get, when running automated Tasks on the project. But very often, they are not precise enough and so someone has to find out, what the user made wrong or what is the problem in the configuration they've made.

Let me give an example here:

We are running the automated task: AutomaticTaskTemplateIds.UpdateMainTranslationMemories on the project. The message, that's comming back is: 'No translation memories found to update for language pair XXX -> YYY'. So far not bad, but there are now variuos things that we have to check to tell the user what he has made wrong. In the example above the user had not ticked the Update Checkbox for the TM. So SDL basically acted correct, but it should give this information back. This would save us time and your support as well, I would say.

So is it possible for you guys to extend the ExecutionMessage with additional info, when you have it availlable?

 

Kind regards,

-Stephan Tandel-

Parents
  • There are 2 ways to get the messges from a batch task:

    1. The RunAutomaticTask method returns and AutomaticTask object that has a Messages property.

    2. Use RunAutomaticTask method that has a status and message handler.

     

    At the moment this are your option. Improving this will require changes in the product so please let me know if this is still not ok for you and we can talk about what would you need.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

  • Hello Romulus, I was wondering if you could offer a few precisions about the AutomatedTasks (the overriden version, with Event Handlers). Ive seen something pretty close to the code that Im posting now, and was wondering: 

    1. What is preventing the code from reaching the "string strErrorMessage line (line 9)? Are the automated tasks blocking operations (in an async wait type of way)? Or, before I move on the the strErrorMsg line, should I do a Task.Status check? do a while loop until its reached the "completed" status, and then check for errors. 

    2. The "List<Sdl.ProjectAutomation.Core.MessageEventArgs> ConversionErrorMessages" object: is this an object that will capture error messages only? or will it get any type of messages from sub operations? 

    Sample code:

    1 #region Automated task: convert the files to a translatable format
    2 AutomaticTask atScan = fpbNewProject.RunAutomaticTask(gSourceFileGuid,
    3 AutomaticTaskTemplateIds.ConvertToTranslatableFormat,
    4 (sender, TaskStatus) => { ConversionTaskStatus.Add(TaskStatus); },
    5 (sender, ScanMessage) => { ConversionErrorMessages.Add(ScanMessage); });
    6 #endregion
    7
    8 #region Check for errors from the automated task operation
    9 string strErrorMessage = "";
    10
    11 if (ConversionErrorMessages.Count > 0)
    12 {
    13 strErrorMessage = string.Format("Errors in automated task {0}", "AutomaticTaskTemplateIds.ConvertToTranslatableFormat");
    14
    15 foreach (Sdl.ProjectAutomation.Core.MessageEventArgs mArgs in ConversionErrorMessages)
    16 {
    17 ProjectFile pfFile = fpbNewProject.GetFile(mArgs.Message.ProjectFileId.Value);
    18 strErrorMessage += string.Format("\nFile: {0}, \nMessage: {1}, \nSource {2}", pfFile.Name, mArgs.Message.Message, mArgs.Message.Source);
    19 }

Reply
  • Hello Romulus, I was wondering if you could offer a few precisions about the AutomatedTasks (the overriden version, with Event Handlers). Ive seen something pretty close to the code that Im posting now, and was wondering: 

    1. What is preventing the code from reaching the "string strErrorMessage line (line 9)? Are the automated tasks blocking operations (in an async wait type of way)? Or, before I move on the the strErrorMsg line, should I do a Task.Status check? do a while loop until its reached the "completed" status, and then check for errors. 

    2. The "List<Sdl.ProjectAutomation.Core.MessageEventArgs> ConversionErrorMessages" object: is this an object that will capture error messages only? or will it get any type of messages from sub operations? 

    Sample code:

    1 #region Automated task: convert the files to a translatable format
    2 AutomaticTask atScan = fpbNewProject.RunAutomaticTask(gSourceFileGuid,
    3 AutomaticTaskTemplateIds.ConvertToTranslatableFormat,
    4 (sender, TaskStatus) => { ConversionTaskStatus.Add(TaskStatus); },
    5 (sender, ScanMessage) => { ConversionErrorMessages.Add(ScanMessage); });
    6 #endregion
    7
    8 #region Check for errors from the automated task operation
    9 string strErrorMessage = "";
    10
    11 if (ConversionErrorMessages.Count > 0)
    12 {
    13 strErrorMessage = string.Format("Errors in automated task {0}", "AutomaticTaskTemplateIds.ConvertToTranslatableFormat");
    14
    15 foreach (Sdl.ProjectAutomation.Core.MessageEventArgs mArgs in ConversionErrorMessages)
    16 {
    17 ProjectFile pfFile = fpbNewProject.GetFile(mArgs.Message.ProjectFileId.Value);
    18 strErrorMessage += string.Format("\nFile: {0}, \nMessage: {1}, \nSource {2}", pfFile.Name, mArgs.Message.Message, mArgs.Message.Source);
    19 }

Children
No Data