Skip to content

Commit

Permalink
fix: error codes for NEXT and LAST
Browse files Browse the repository at this point in the history
  • Loading branch information
sntran committed Mar 12, 2021
1 parent c184f73 commit 5414832
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gen_nntp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ handle_command(<<"NEXT">> = Cmd, Client) ->
true ->
{ok, ArticleInfo, State2} = Module:handle_NEXT({ArticleNumber, Group}, State1),
case ArticleInfo of
false -> {<<"423 No article with that number">>, ArticleNumber, State2};
false -> {<<"421 No article with that number">>, ArticleNumber, State2};

% Current article number is already the last article
{ArticleNumber, _} ->
Expand Down Expand Up @@ -559,7 +559,7 @@ handle_command(<<"LAST">> = Cmd, Client) ->
true ->
{ok, ArticleInfo, State2} = Module:handle_LAST({ArticleNumber, Group}, State1),
case ArticleInfo of
false -> {<<"423 No article with that number">>, State2};
false -> {<<"422 No article with that number">>, State2};

% Current article number is already the first article
{ArticleNumber, _} ->
Expand Down

0 comments on commit 5414832

Please sign in to comment.