differentiate between errors in bytestring