Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

In DXL, lasterror() is not working

Hello,

I have a query or problem with the DXL script in latest version 9728

 

Following is the problem noError() & lastError() used to suppress the error and to stop the immediate halt.

In the new version may be it suppressed but still the suppressed error is lost.

 

Below is not a custom code – It is a two liner how to read a module (just a basic example

 

Code1: [Positive case]

noError() // this works like a try

 

print "before load module" "\n"

 

string moduleFullName = "/Training_HandsOn/mmd1kor/MO_Template"

Module mod = read(moduleFullName)

 

print "after load module" "\n"

 

string lastErr=lastError() // this works like a catch

if(!null lastErr){

               print "Error" "\n"

               print lastErr

}else{

               print "No Error"

}

 

Output:

before load module

after load module

No Error

 

-----

 

Code2: [Failure case: expectation code prints the Error but it is not happening ]

noError() // this works like a try

 

print "before load module" "\n"

 

string moduleFullName //i didnot provide value i declared null

Module mod = read(moduleFullName)

 

print "after load module" "\n"

 

string lastErr=lastError() // this works like a catch

if(!null lastErr){

               print "Error" "\n"

               print lastErr

}else{

               print "No Error"

}

 

Output:

before load module

Anyone help me? Thanks in advance.     

1

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: May 31 '24, 1:29 p.m.

Question was seen: 300 times

Last updated: Jun 03 '24, 1:52 a.m.

Confirmation Cancel Confirm