HNES icon indicating copy to clipboard operation
HNES copied to clipboard

Add better support for HN errors

Open ibejoeb opened this issue 9 years ago • 0 comments

HN generally does not use HTTP status codes to signify errors during story or comment submission, so we have to determine the appropriate behavior by inspecting the response. HNES uses XHR to submit in the background. During these submissions, we need to parse and handle the following common error strings from the response body:

"Please try again."

"Stories can't have both urls and text, so you need to pick one. If you keep the url, you can always post your text as a comment in the thread."

"You're submitting too fast. Please slow down. Thanks."

"Sorry, your account is too new to submit this site."

"Stop spamming us. You're wasting your time."

"Sorry, that story was previously submitted."

References: #108, #109

ibejoeb avatar Jul 02 '16 04:07 ibejoeb