duckduckgo / p5-app-duckpan

DuckDuckHack OpenSource Development Application
http://metacpan.org/module/App::DuckPAN
Other
53 stars 47 forks source link

Stop DuckPAN on failed API request, improve success/fail messaging #89

Closed moollaza closed 10 years ago

moollaza commented 10 years ago

When DuckPAN makes an API request, we should better indicate when the request fails (and maybe when it's successful) but mostly DuckPAN should probably stop execution and let the developer know.

For example after purposely breaking the URL for the NPM Spice, the DuckPAN server doesn't display anything on the page but if you look very closely in the terminal output you'll see that the request returned a 500 Error:

image

I think when the request isn't a success, the DuckPAN Server should stop (or at the very least make it obvious what went wrong) and notify the user clearly that the request failed. Here's the code the would need to be updated: https://github.com/duckduckgo/p5-app-duckpan/blob/master/lib/App/DuckPAN/Web.pm#L146-166

killerfish commented 10 years ago

I have a few ideas, ill check it out