add a new module (error.c) for displaying error messages

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>