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

Bug 343181

Summary: [server] Job should be able to return more details about a failure
Product: [ECD] Orion Reporter: Malgorzata Janczarska <malgorzata.tomczyk>
Component: ClientAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, Szymon.Brandys, tomasz.zarna
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 343174    
Bug Blocks: 336822    

Description Malgorzata Janczarska CLA 2011-04-18 13:49:23 EDT
In git operations that use progress service we would like to handle some errors on the client site, for instance: wrong/missing server fingerprint, password/private key needed. Currently all we can return in the task error details is a string message and result http status is 500. It would be good if the task could indicate a type of an error, for instance 401 and pass some more details, for instance in json, like {host: "dev.eclipse.org", fingerprint: "45:59:..."}.
How do you think we could do it? Adding a dedicated status type and pass additional information?
Comment 1 John Arthorne CLA 2011-04-19 10:44:45 EDT
If you pass a ServerStatus to TaskInfo#done() then the httpCode should at least be available...

The task service needs to know how to serialize the status, so arbitrary status extensions or subclasses won't work.

As we talked about yesterday, it would be simpler workflow for the original request to fail with 401 rather than return a task that contains the failure.
Comment 2 Malgorzata Janczarska CLA 2011-04-19 12:22:01 EDT
I added "error data" param to ServerStatus and already used it to pass the server fingerprint. It works for my needs, but if you have a better idea for it please reopen this bug.