jhthorsen / app-mojopaste

Pastebin
38 stars 19 forks source link

Don't crash on non existent pastes / File::Spec / general cleanup #8

Closed stephan48 closed 8 years ago

jhthorsen commented 8 years ago

I can't taket this pull request without a test. I also think it should rather be something like this:

my $paste = File::Spec->catfile($paste_dir, $paste_id);
return $c->reply->not_found unless -r $paste;
return $self->render(content => decode "UTF-8", slurp $paste);

To be honest, I don't really get my original code either. I can implement the change, unless you update the PR.

stephan48 commented 8 years ago

Would it make sense to reevaluate all the cases I fixed in my commits?

jhthorsen commented 8 years ago

I think I have "converted" your commits now. Let me know if I'm wrong. Some more comments:

Also, please rebase and push again next time. It's difficult to read the different commits when they append to previous commits in the same PR.

jhthorsen commented 8 years ago

Closing this, since I don't believe there are any open issues.