Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Unable to upload anything #4

Closed
alexeyklyukin opened this Issue Mar 15, 2011 · 5 comments

Comments

Projects
None yet
2 participants

Hi,

I've recently registered to PGXN and tried to upload a simple extension ( http://www.commandprompt.com/files/countnulls.tar.gz ). However, I'm getting 'Whoops! Some sort of error occurred.' on every upload attempt. I'm using Safari, but this error also occurs with Firefox and probably other browsers.

Owner

theory commented Mar 15, 2011

Yes, I see the errors. Will look into it this morning. Thanks for the report.

Owner

theory commented Mar 15, 2011

Just tried it on an install on my local box, and got this error:

Cannot parse JSON from “countnulls/META.json”: '"' expected, at character offset 420 (before "}")

I think the issue is the comma on line 20. Delete that and try again.

Meanwhile, I'm looking into why the server doesn't deliver the same message as my local install; seems like it'd be a lot more useful…

Owner

theory commented Mar 15, 2011

Looks like you tried again and still got errors, yeah? I'm looking into it…

Owner

theory commented Mar 15, 2011

Okay, found the problem. You should be able to upload the distribution now. Thanks for the report!

Owner

theory commented Mar 15, 2011

Fix a few extraction-related bugs.

First, require HTTP::Body 1.08. That's the module that creates the temp files
used for uploads, and 1.08 properly appends the file name suffix to the temp
file, which allows Archive::Extract to figure out what the archive type is.
With older versions of HTTP::Body, if a non-zip file was uploaded,
Archive::Extract could not determine what the archive format was, and died.

Relatedly, properly catch such a death. One of the downsides of Try::Tiny that
I keep forgetting is that it uses subroutine references. So a return returns
from those references, not from the method that's calling them. That's a
significant difference from the behavior of eval or, indeed, of a
hypothetical try keyword in Perl itself. Anyway, the fix is to always return
from the blocks passed to try, and to use the return value of try as the
return value of the method. This is what allowed me to see that
Archive::Extract was getting confused, whereas before it just ate the error.

As a benefit, extract() now properly returns false on failure. The tests
were wrong before, expecting it to return true. Guh.

Closed by a8fce0c.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment