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

Bug 331065

Summary: improve Bugzilla client error handling and error messages
Product: z_Archived Reporter: David Green <greensopinion>
Component: MylynAssignee: David Green <greensopinion>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse, robert.elves
Version: unspecified   
Target Milestone: 3.5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch that improves error handling
none
mylyn/context/zip
none
mylyn/context/zip
none
recut patch against HEAD
steffen.pingel: iplog+
mylyn/context/zip none

Description David Green CLA 2010-11-24 17:04:48 EST
Bugzilla provides an HTML message in a tag identified by id 'error_msg'.  It's possible to improve error handling to use IStatus.ERROR instead of IStatus.INFO and provide a more descriptive message in some cases.
Comment 1 David Green CLA 2010-11-24 17:06:28 EST
Created attachment 183808 [details]
patch that improves error handling

I've created a patch that looks for the 'error_msg' element to extract the error message as it's intended to be displayed to the user.  When found, a status with severity of IStatus.ERROR is created instead of IStatus.INFO.
Comment 2 David Green CLA 2010-11-24 17:06:30 EST
Created attachment 183809 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2010-11-24 18:37:03 EST
Looks like a good idea to me. Frank, can you review the changes?
Comment 4 Frank Becker CLA 2010-11-29 16:30:28 EST
(In reply to comment #0)
> Bugzilla provides an HTML message in a tag identified by id 'error_msg'.  It's
> possible to improve error handling to use IStatus.ERROR instead of IStatus.INFO
> and provide a more descriptive message in some cases.

Sorry I can not reproduce this. What I need is the cases where you see the error_msg.

Midair-Collision and invalide secureToken did not include this tag.
Comment 5 David Green CLA 2010-12-02 16:50:08 EST
I don't recall how I reproduced this scenario.  There are some cases where error_msg is set but not used in the client.  It's these scenarios that this patch is intended to fix.
Comment 6 Frank Becker CLA 2010-12-05 13:40:08 EST
(In reply to comment #5)
> I don't recall how I reproduced this scenario.  There are some cases where
> error_msg is set but not used in the client.  It's these scenarios that this
> patch is intended to fix.

I think we should do some work in this area. Most errors are fethched by Mylyn using the <title> and  languagesettings.
Mybe it is better to use the <td> with id=error_msg.

There is no better way because bugzilla did not have an error number so we need to deal with all supported language.

Thoughts?
Comment 7 Frank Becker CLA 2010-12-05 13:40:25 EST
Created attachment 184558 [details]
mylyn/context/zip
Comment 8 Steffen Pingel CLA 2010-12-06 08:32:32 EST
In case we don't recognize the error using the current mechanism, would it make sense to use the solution suggested by David? 

For Bugzilla 4.0 and later we should be able to use the error id so this will be less of a concern moving forward.
Comment 9 David Green CLA 2010-12-06 13:02:30 EST
+1
Comment 10 Frank Becker CLA 2010-12-06 15:21:01 EST
(In reply to comment #8)
> In case we don't recognize the error using the current mechanism, would it make
> sense to use the solution suggested by David? 
> 
> For Bugzilla 4.0 and later we should be able to use the error id so this will
> be less of a concern moving forward.


Steffen,

I did not know where we have the error id. What I requested was the reason for "Suspicious Action".

Should I request an bugzilla enhancement for add the internal error field in an comment html tag.
Comment 11 David Green CLA 2010-12-06 15:41:56 EST
Created attachment 184655 [details]
recut patch against HEAD

recut patch against HEAD
Comment 12 David Green CLA 2010-12-06 15:41:58 EST
Created attachment 184656 [details]
mylyn/context/zip
Comment 13 Steffen Pingel CLA 2010-12-06 16:25:34 EST
(In reply to comment #10)
> Should I request an bugzilla enhancement for add the internal error field in an
> comment html tag.

Yes, we should have a unique ID for all errors in Bugzilla. Having that in an HTTP header (easy to parse) or HTML tag would be very useful.
Comment 14 Frank Becker CLA 2010-12-06 16:27:03 EST
(In reply to comment #11)
> Created an attachment (id=184655)
> recut patch against HEAD
> 
> recut patch against HEAD

David,

I verify your patch an commit it to HEAD.

But because I did not use httpAuthCredentials I can not test the authenticate change, looking into the code seams to be OK.
Comment 15 Frank Becker CLA 2010-12-07 00:55:09 EST
(In reply to comment #13)
> (In reply to comment #10)
> > Should I request an bugzilla enhancement for add the internal error field in an
> > comment html tag.
> 
> Yes, we should have a unique ID for all errors in Bugzilla. Having that in an
> HTTP header (easy to parse) or HTML tag would be very useful.

I create the enhancement https://bugzilla.mozilla.org/show_bug.cgi?id=617256
Comment 16 David Green CLA 2011-01-04 19:50:41 EST
This looks done to me: anything else to do here?
Comment 17 Steffen Pingel CLA 2011-02-05 16:53:48 EST
Thanks David. Closing.