Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354420

Summary: ServiceLib.serviceExceptionHandler cannot be resolved
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: joepluta, joepluta, jqian, jvincens, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-10 14:19:15 EDT
EDT code

package explore;
handler CreateResultFile
	private trService TestResultService{@dedicatedService{}};
	function createFile(fileDirectory String in, fullFileName String in, fileContent String in)	
		call trService.createFile(fileDirectory, fullFileName, fileContent) returning to fileCreated onException ServiceLib.serviceExceptionHandler;	
	end	
	private function fileCreated(absoluteFilePath string in)
		syslib.writeStdOut("The result file: " + absoluteFilePath + " is created");
	end

end

Gets validation error:
IWN.VAL.6619.e 11/119 CreateResultFile - ServiceLib.serviceExceptionHandler cannot be resolved. At line 11 in file \FrameworkMini\eglsource\explore\CreateResultFile.egl
Comment 1 Paul Harmon CLA 2011-08-16 15:36:48 EDT
I have updated the definition of ServiceLib to make this field static. I also changed some validation code in DefaultBinder that was incorrect.
Comment 2 Kathy Carroll CLA 2011-08-17 12:14:13 EDT
verified
Comment 3 Lisa Lasher CLA 2011-10-11 16:01:09 EDT
Closing this defect.
Comment 4 Joe Pluta CLA 2011-11-30 23:10:02 EST
(In reply to comment #3)
> Closing this defect.

I'm still seeing the problem.  IWN.VAL.6619.e 15/29 TestService - ServiceLib.serviceExceptionHandler cannot be resolved. At line 15 in file \MyProject\EGLSource\client\TestService.egl


Build: Version: 0.7.0.v201111270901-1CT-Fiv5_LLLMAxfU_J

My code:

handler TestService type RUIhandler{initialUI =[ui],
	onConstructionFunction = start, cssFile = "css/MyProject.css", title = "TestService"}

    ui Div {  };
    DataSvc DataSvc? { @DedicatedService };

    function start()
        call DataSvc.getItems() returning to CB_getItems
	onException ServiceLib.serviceExceptionHandler;
    end
	
    function CB_getItems(texts string[] in)
    	for (x int from 1 to texts.getSize())
    		ui.appendChild(new HTML { text = texts[x] });
    	end
    end
end
Comment 5 Jing Qian CLA 2011-12-01 10:24:04 EST
in EDT, we no longer have ServiceLib.serviceExceptionHandler defined as system library/delegate, end user must define their own callback function for exception handling
Comment 6 Joe Pluta CLA 2011-12-01 15:30:56 EST
(In reply to comment #5)
> in EDT, we no longer have ServiceLib.serviceExceptionHandler defined as system
> library/delegate, end user must define their own callback function for
> exception handling

Why was that done?  Now every piece of code that used that handler as a convenient default handler for unexpected exceptions has to be modified.
Comment 7 Joseph Vincens CLA 2011-12-19 09:23:50 EST
(In reply to comment #6)
> (In reply to comment #5)
> > in EDT, we no longer have ServiceLib.serviceExceptionHandler defined as system
> > library/delegate, end user must define their own callback function for
> > exception handling
> 
> Why was that done?  Now every piece of code that used that handler as a
> convenient default handler for unexpected exceptions has to be modified.

There are at least a couple reasons for this. 
There is more information than just the exception. There is also the HttPResponse which sometimes contains more information and some users choose to print that instead of just the exception. 
writestdout is really not a good way of displaying the information, it's quick, but from looking at many RBD applications it's not the best way.

So we leave it up to the developers to determine what they want to display and how they want to display it, writestdout, html, sending it back to a service to be logged to a file, etc. 
This kind of thing is something that could just as easily be developed as a utility library based on your needs and you use it in all of your projects.