ghmo / google-refine

Automatically exported from code.google.com/p/google-refine
0 stars 0 forks source link

UI should display errors in a user-friendly way #165

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I would like for the UI catch errors and display them in a user-friendly way.  
Further enhancement would be for the user to be able to report the issue with a 
link to http://code.google.com/p/google-refine/issues/

I think this might be achieved for most errors by adding the following 
somewhere:
$.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) {
//code to display a people-friendly dialog with the error message and link to 
report the issue.
}});

Original issue reported on code.google.com by iainsproat on 20 Oct 2010 at 10:48

GoogleCodeExporter commented 8 years ago
Actually, does $.ajaxSetup overwrite locally defined error handling functions?  
If so, probably not a good solution.

In particular I was testing importing a corrupted project, but the browser 
stays on the 'Starting Up' spinner.  (an error is output to the log though).

Firebug reports the following:
GET 
http://127.0.0.1:3333/command/core/get-project-metadata?project=2011335124043
500 Failed to find project id #2011335124043

Would some error handling added to line 126 of 
/webapp/modules/core/scripts/project.js do the trick for this particular 
function?

Original comment by iainsproat on 20 Oct 2010 at 12:56

GoogleCodeExporter commented 8 years ago
I think we should only resort to ajaxSetup's error handler when all else fails. 
The get-project-metadata command should just return an error message in proper 
json, e.g.,

{
  "status" : "200 OK",
  "code" : "/api/status/error",
  "message" : [{
     "message" : "Project file is corrupted and cannot be imported.",
     "lang" : "en"
  }]
}

All these messages need to be localized sooner or later.

Original comment by dfhu...@gmail.com on 20 Oct 2010 at 5:09