Title: Should return error code 400 instead of 500 on wrong code
Last modified: August 7, 2017

---

# Should return error code 400 instead of 500 on wrong code

 *  [jarnoan](https://wordpress.org/support/users/jarnoan/)
 * (@jarnoan)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/should-return-error-code-400-instead-of-500-on-wrong-code/)
 * When a reader tries to post a comment but fails to provide a correct captcha 
   code, the plugin returns HTTP status 500 (internal server error). Since the problem
   is in the data supplied by the user and not with the server, the plugin should
   return status code 400 instead.
 * Looks fairly easy to fix as wp_die supports giving the HTTP status code as an
   argument.
 * Error code 500 causes our log monitoring to give false error alerts.

The topic ‘Should return error code 400 instead of 500 on wrong code’ is closed 
to new replies.

 * ![](https://ps.w.org/captcha-code-authentication/assets/icon-256x256.png?rev=
   3013521)
 * [Captcha Code](https://wordpress.org/plugins/captcha-code-authentication/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/captcha-code-authentication/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/captcha-code-authentication/)
 * [Active Topics](https://wordpress.org/support/plugin/captcha-code-authentication/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/captcha-code-authentication/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/captcha-code-authentication/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [jarnoan](https://wordpress.org/support/users/jarnoan/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/should-return-error-code-400-instead-of-500-on-wrong-code/)
 * Status: not resolved