convert bytes to string for printing in error message