Add printf format attribute for error creation helper