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

Bug 170536

Summary: [api] unified error handling
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: robert.elves, wmitsuda
Version: dev   
Target Milestone: 2.0 M3   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Error handling related fixes
none
mylar/context/zip
none
makes status API more robust
none
mylar/context/zip none

Description Steffen Pingel CLA 2007-01-15 15:25:02 EST
Mylar's error handling should be unified to avoid code duplication and simplify error reporting for connectors. This has been discussed as part of bug 165498 but is still work in progress. So far an interface IMylarStatusConstants has been created that defines common error codes. MylarStatus defines corresponding error messages that are displayed by RepositoryAwareStatusHandler.
Comment 1 Steffen Pingel CLA 2007-01-15 16:10:01 EST
Created attachment 56935 [details]
Error handling related fixes
Comment 2 Steffen Pingel CLA 2007-01-15 16:10:03 EST
Created attachment 56936 [details]
mylar/context/zip
Comment 3 Steffen Pingel CLA 2007-01-15 16:25:01 EST
I think it makes sense to log all errors that have status.getCode() == IMylarStatusConstants.INTERNAL_ERROR to the error log so users can easily submit them as bug reports. We should probably also use the failure dialog for those.
Comment 4 Robert Elves CLA 2007-01-15 18:38:28 EST
> Error handling related fixes
Applied.
Comment 5 Steffen Pingel CLA 2007-01-21 22:42:17 EST
Reminder: Look at error reporting of failed Trac searches.
Comment 6 Robert Elves CLA 2007-01-24 13:31:59 EST
 (In reply to comment #3)
> I think it makes sense to log all errors that have status.getCode() ==
> IMylarStatusConstants.INTERNAL_ERROR to the error log so users can easily submit
> them as bug reports. We should probably also use the failure dialog for those.

The Mylar error dialog will now be displayed for INTERNAL_ERROR. I updated the bug report submission url and now indicate that Report as Bug can be used as well.
Comment 7 Steffen Pingel CLA 2007-05-06 22:46:21 EDT
Created attachment 66042 [details]
makes status API more robust

The patch introduces RepositoryStatus that takes a mandatory URL which points to the repository the status is related to. Factory methods are provided to create status objects with default error messages for common errors (such as failed logins).

The patch moves the current Status implementation to the Bugzilla plug-in to avoid breakage. Rob, I think factory methods are a good way to communicate the required parameters to construct a meaningful status object for specific errors. I leave it to you to refactor the Bugzilla code.

Handling of HTML messages is stil work in progress. Let's discuss that on the next conference call.
Comment 8 Steffen Pingel CLA 2007-05-06 22:46:23 EDT
Created attachment 66043 [details]
mylar/context/zip
Comment 9 Mik Kersten CLA 2007-05-07 00:40:48 EDT
Rob: please review.
Comment 10 Robert Elves CLA 2007-05-07 19:04:09 EDT
Patch applied.
Comment 11 Steffen Pingel CLA 2007-05-07 19:20:14 EDT
Fixed failing test cases. 

Resolving.
Comment 12 Steffen Pingel CLA 2007-06-11 19:49:22 EDT
As part of the renaming (bug 191406) MylarStatus was merged with RepositoryStatus. RepositoryStatus.getRepositoryUrl() can now return null if the status does not relate to a repository.