What should you have done or what should you do next time? I don't particularly like telling people what they should and should not do unless I'm in some sort of parental relationship with them, but I thought I'd take a stab at reading the question as if it were me tasked with reviewing it, to see what I would do.
I don't know about the technologies the OP mentions, but I do know the OP makes a lot of assumptions as they explain:
In a programming language a function typically return integer value to
denote success/failure state. Zero is typically treated as success and
non-zero is treated as failure.
It becomes clear as the post progresses that they are actually talking about C++, but even then they are still making assumptions. This tells me it needs editing.
The OP then proceeds to converse with the reader in a blog post way about their discovery process for arriving at the answer to their broad question,
How do i effectively handle errors thrown by ITKs in Teamcenter server
customization?"
That answer is effectively, "Don't use the return value of 0 for success, and non-zero for failure; use the language's built-in exception handling (try / catch in this case)."
To me it seems that, though I know nothing about Teamcenter, I know enough about programming in a few languages to realize that what they are really trying to do is say, "Hey, cool! Using a language's built-in exception handling works really well for handling errors!" in a pseudo-question format. The OP said in the comments on the question that they tried to find the answer on SO, but couldn't find it, then when they discovered the answer, they wanted to share. I would submit that the OP didn't find the answer on SO because SO isn't a tutorial site, nor is it a learn-to-program site. The answer the OP discovered is pretty basic for someone who has a background in Computer Science, or for someone who has years of experience with programming.
If the OP had actually asked the question and let the SO community share their knowledge, the OP might have had a good Q&A (or might have been referred to other questions about exception handling in C++). So, in my opinion, the post, as is, belongs on a blog. If edited, the real question isn't the question asked. I wouldn't want to be responsible for editing it, because it wouldn't look much like the OP's original question, and the OP would likely wonder what happened to all his wonderful explanation.
What have I done here? I have reduced the post to its essence: what is the OP trying to say, why are they saying it, why do they take so long to get there, and how could it be shortened?
So, I would suggest next time, try to do that: reduce the post to its essential parts.