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 Reply Children
  • Hey Romulus,

    thanks for your answer. We're using the first option you mention. Does the second option return different/more precise information on the cause of a problem?

    If not, then it doesn't help. We could of cause, like Jesse wrote, extend the error with our custom error message, but that's wrong in my understanding of an API Design. In the example I mentioned, how can our software know, that an action is not possible because of a specific (incorrect) configuration in SDL Studio? And as Studio changes of cause, we would have to addapt our custom messages as well.
    So to me, the API should point to this problem more exactly.

    But in general it is more or less impossible to prepare a list of API calls, where more precise error messages are needed. Perhaps you should take it as a general quality requirement to the API developments. With this written, i know that it's hard to measure if the result message is ok or not. But the more information the API can give back, the better.

    All the best,
    -Stephan Tandel-
  • The second option allows you to hook at the moment the task status is changed. The exception messages will be the same because this come from Studio internal implementation and are not specific to the API (the same error will be displayed on the user interface too). That's also the reason why I asked if you are aware of certain situations you would like to have a more specific error message.

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

  • We have cases, where the files can't be analyzed/converted to sdlxliff. If we process the files in Trados directly, it will display informations on why/how. If you process the same files with the API/SDK we don't get any events and the Messages-object is empty. Do you have any idea why this could happen?
  • 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 }