Skip to content

Refactor commands in handle_command for less redundancy in error handling

DISSOUBRAY Nathan requested to merge handle_command_error_refactor into master

Description

There were a lot of repetitions involving sending back the result of commands and checking that the result was properly received. By changing the different parts of the match statement in handle_command to use functions returning results instead, we can reduce the redundancy.

Note

Not all match statements have been refactored, because it either doesn't make sense (no redundancy in the given match), or there it is not possible as is due to having to use the sender for the operation as well as the error handling (and we have problems with move of value).

Merge request reports