sadfasdf2 / google-refine

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

Error in exception handling for ExportRows command #401

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As reported in issue 351 (and also shown in issue 122), there's a bug in the 
exception handling for the export command which causes it to fail to report the 
actual error that occurred.  This obscures the root cause of problems and makes 
debugging more difficult.

Any other commands which use non-JSON responses should probably be checked to 
make sure they don't suffer from the same issue.

Stack trace is below.  The problem is caused by the fact that the response 
object contains a reference to a Stream, rather than a Writer.  The default 
exception handler deals with this correctly by resetting the response.
--------
HTTP ERROR 500

Problem accessing /command/core/export-rows/mydata.xls. Reason:

    STREAM
Caused by:

java.lang.IllegalStateException: STREAM
    at org.mortbay.jetty.Response.getWriter(Response.java:616)
    at org.mortbay.servlet.GzipFilter$GZIPResponseWrapper.getWriter(GzipFilter.java:358)
    at com.google.refine.commands.Command.respond(Command.java:237)
    at com.google.refine.commands.Command.respondException(Command.java:305)
    at com.google.refine.commands.project.ExportRowsCommand.doPost(ExportRowsCommand.java:103)
    at com.google.refine.RefineServlet.service(RefineServlet.java:171)

Original issue reported on code.google.com by tfmorris on 7 Jun 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Fixed in r2093.

Original comment by tfmorris on 7 Jun 2011 at 11:52

GoogleCodeExporter commented 9 years ago

Original comment by tfmorris on 9 Jun 2011 at 7:58