As I wanted to get the custom error-code along with the custom error-text, I used the regex-class "%Regex.Matcher" to pull the content/custom-text within the parenthesis in the error-text.  This served my purpose.  Thanks for looking into it... :-)

Here is the modified code:

Class ISG.CommonBilling.Service.Test1 Extends EnsLib.HL7.Operation.TCPOperation
{

ClassMethod khalid() As %Status
{
Set tSC=$$$ERROR("10001","I am here")
write $$$GETERRORCODE(tSC)_$char(13,10)
write ##class(%Regex.Matcher).%New(".*\((.*)\).*",$SYSTEM.Status.GetErrorText(tSC)).ReplaceAll("$1")
}

}

 

Output:

KINDRED>do ##class(ISG.CommonBilling.Service.Test1).khalid()
10001
I am here