[PATCH v2 20/71] lib: Support printing an error string