factor two very similar error messages
Summary: Instead of changing the layout of the two messages in D10148 because of the change of indentation, create a static function that build this message.
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10159