catch errors for invalid hex strings