# Passing an api\_username for a user that does not exist returns a 500 with no useful context

**URL:** <https://meta.discourse.org/t/passing-an-api-username-for-a-user-that-does-not-exist-returns-a-500-with-no-useful-context/46407>\
**Category:** Development\
**Created:** [2016 年6 月 24 日 16:06 UTC](https://meta.discourse.org/t/passing-an-api-username-for-a-user-that-does-not-exist-returns-a-500-with-no-useful-context/46407 "2016-06-24T16:06:12Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

作者： ![cappslock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cappslock/32/120789_2.png) [@cappslock](https://meta.discourse.org/u/cappslock)\
发布日期： [2016 年7 月 30 日 22:07 UTC](https://meta.discourse.org/t/passing-an-api-username-for-a-user-that-does-not-exist-returns-a-500-with-no-useful-context/46407/6 "2016-07-30T22:07:01Z")

</div>

Thanks for the reply. In my tests, it would reply with a 500 with no  
response body. It’s impossible to know the reason for the failure in that  
case. I would think something in the 4xx range with some information  
indicating the cause of the error (a username that does not exist) would be  
more helpful and appropriate, no?

---

_[View the full topic](https://meta.discourse.org/t/passing-an-api-username-for-a-user-that-does-not-exist-returns-a-500-with-no-useful-context/46407)._
