When an exception is thrown by the code I catch it and write the message to the log. Then I return a failure to the server. something like this:
public ACJE.JobOutcome Execute(ACJE.IJobProcessorServices context, ACJE.IJob job)
{
try
{
// Fail for some reason here
Throw new exception()
}
catch (Exception ee)
{
context.Log("Exception while generating. msg: " + ee.Message, ACJE.MessageType.eError);
return ACJE.JobOutcome.Failure;
}
}
My problem starts when the Execcute(...) method is called a 2e time. Then I get an axception:
System.Runtime.InteropServices.COMException: 'The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)'
When I call:
_inventor.ApplicationAddIns.get_ItemById("{fc7e397d-6e67-4b0d-a4e1-82adf2d692d0}");
(which works fine the 1e time)
This exception is also handled but it will overwrite the original log message with the original exception message. This makes error handling in production much hared because I never see the original message.
is there some way to detect that the Execcute(...) method is called a 2e time?
Or is there a way to preserve the original log message?
Edit:
I found a bug in the code that results in the "The RPC server is unavailable. " exception on the second run. So that is not a problem. but I still would like answers to my questions about detecting a second call of the Execcute(...) method.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
Solved! Go to Solution.
When an exception is thrown by the code I catch it and write the message to the log. Then I return a failure to the server. something like this:
public ACJE.JobOutcome Execute(ACJE.IJobProcessorServices context, ACJE.IJob job)
{
try
{
// Fail for some reason here
Throw new exception()
}
catch (Exception ee)
{
context.Log("Exception while generating. msg: " + ee.Message, ACJE.MessageType.eError);
return ACJE.JobOutcome.Failure;
}
}
My problem starts when the Execcute(...) method is called a 2e time. Then I get an axception:
System.Runtime.InteropServices.COMException: 'The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)'
When I call:
_inventor.ApplicationAddIns.get_ItemById("{fc7e397d-6e67-4b0d-a4e1-82adf2d692d0}");
(which works fine the 1e time)
This exception is also handled but it will overwrite the original log message with the original exception message. This makes error handling in production much hared because I never see the original message.
is there some way to detect that the Execcute(...) method is called a 2e time?
Or is there a way to preserve the original log message?
Edit:
I found a bug in the code that results in the "The RPC server is unavailable. " exception on the second run. So that is not a problem. but I still would like answers to my questions about detecting a second call of the Execcute(...) method.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
Solved! Go to Solution.
Solved by Markus.Koechl. Go to Solution.
Hi @JelteDeJong, I am not sure I understood your point or problem. Is the second execution related to the Job retry setting enabled? If so, you need to evaluate the retry parameter "RetriesCount"/"Value" of the Job Parameter array.
Hi @JelteDeJong, I am not sure I understood your point or problem. Is the second execution related to the Job retry setting enabled? If so, you need to evaluate the retry parameter "RetriesCount"/"Value" of the Job Parameter array.
I did not know about this setting. But I found it and I expect that this is why a job is called a 2e time.
I also found the parameter and could solve my issue.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
I did not know about this setting. But I found it and I expect that this is why a job is called a 2e time.
I also found the parameter and could solve my issue.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
Can't find what you're looking for? Ask the community or share your knowledge.