# API handling of fetching missing slugs

**URL:** <https://forum.beeminder.com/t/api-handling-of-fetching-missing-slugs/997>\
**Category:** Bugabee\
**Created:** [July 27, 2015, 8:40pm UTC](https://forum.beeminder.com/t/api-handling-of-fetching-missing-slugs/997 "2015-07-27T20:40:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![galtsubery](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@galtsubery](https://forum.beeminder.com/u/galtsubery)\
**Post date:** [July 27, 2015, 8:40pm UTC](https://forum.beeminder.com/t/api-handling-of-fetching-missing-slugs/997/1 "2015-07-27T20:40:26Z")

</div>

Hi,

I recently used beeminder gem and noticed a bug when trying to access unrecgonized slugs.  
The gem throws the following exception:

```
RuntimeError: request failed: 500 / {"error":"You need to sign in or sign up before continuing."}

```

This error makes it hard to recognize the problem.  
If the problem is lack of authorization the error code should be 401 or 403.  
In the case of a valid auth token and just a missing resource, 404 is accurate.  
This will allow easier handling of edge cases.  
Ideally the gem will be able to raise only one of a fixed list of custom exceptions.

Thanks!
