Rocket.Chat
Rocket.Chat copied to clipboard
Bug when calling REST API for room messages
Got Error: Cannot return null or undefined from an endpoint: get api/rooms/:id/messages/:ts\n at packages/nimble_restivus/lib/route.coffee:61:25\n
Tried testing by giving invalid room ID.
The error handling seems to be missing. Any advice ?
I can advice you to pass only valid room IDs until someone fix that :smile:
@afaizal What version of Rocket Chat did you use to test the above scenario. I tested the above route with version 0.33 and here is the output
curl -H "X-Auth-Token: jtia1b3kqkN4IgcTBuyTZ_-TlSTjqSkJ4PxKiGeV1eI" -H "X-User-Id: ibHxrcoR66M2wNf7d" http://localhost:3000/api/rooms/nonexistingroom/messages
{
"status": "fail",
"message": "Error :: Invalid room [error-invalid-room]"
`
thanks @Deepakkothandan .. I tried and got the same result.