Skip to content

Commit

Permalink
api [nfc]: Describe getSingleMessage error cases more explicitly
Browse files Browse the repository at this point in the history
In particular make it clear that while this function can return void,
that is not what it does in the case where the message doesn't exist.

(Based on going and reading the linked server API doc.)
  • Loading branch information
gnprice committed Oct 8, 2022
1 parent 6a6409d commit 6c532de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api/messages/getSingleMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ type ServerApiResponseSingleMessage = {|
/**
* See https://zulip.com/api/get-message
*
* Gives undefined if the `message` field is missing, which it will be for
* FL <120.
* Throws an error if the message doesn't exist at all, or isn't visible to
* our user.
*
* Otherwise, gives undefined on old servers (FL <120) where this API
* endpoint doesn't return a `message` field.
*/
// TODO(server-5.0): Simplify FL-120 condition in jsdoc and implementation.
export default async (
Expand Down

0 comments on commit 6c532de

Please sign in to comment.