Minor thing, but send_error already has a version that will format a message with io_lib:format as you can see in the line #202 above