logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Login


Options
View
Go to last post Go to first unread
Benjamin  
#1 Posted : Saturday, June 16, 2012 8:42:39 PM(UTC)
Benjamin

Rank: Advanced Member

Groups: Registered
Joined: 7/10/2011(UTC)
Posts: 34

Thanks: 1 times
I noticed this evening that my app is throwing an error whenever it calls GetDeparturesByStop for a stop with no buses coming. The API (versions 2.0 and 2.1) reports

Code:
{
  "time": "2012-06-16T21:40:44-05:00",
  "new_changeset": true,
  "status": {
    "code": 200,
    "msg": "ok"
  },
  "rqst": {
    "method": "GetDeparturesByStop",
    "params": {
      "pt": 60,
      "stop_id": "APTHICRS"
    }
  }
}


which causes an error in my app, since it expected a "departures" array, even if an empty one. This request goes fine when there are buses coming.

Edited by user Saturday, June 16, 2012 8:43:52 PM(UTC)  | Reason: fix

Ryan  
#2 Posted : Monday, June 18, 2012 2:50:41 PM(UTC)
Ryan

Rank: Administration

Groups: Administrators, Registered
Joined: 6/1/2011(UTC)
Posts: 88
United States
Location: Urbana

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Sorry about that. The issue should be fixed now. By the way, if there are no buses coming it will indeed return an empty array and a 200 status code, but if you request a stop that doesn't exist it will return a 404 as the status code and "Stop not found" as the message. Hopefully this will allow developers to display the appropriate message to their users.
thanks 1 user thanked Ryan for this useful post.
Benjamin on 6/18/2012(UTC)
Benjamin  
#3 Posted : Monday, June 18, 2012 3:04:40 PM(UTC)
Benjamin

Rank: Advanced Member

Groups: Registered
Joined: 7/10/2011(UTC)
Posts: 34

Thanks: 1 times
Yes, it is working now. Thanks!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.