The failure message should have the response in a byte array.

handleSuccessMessage() was being (properly) handed a byte array, but handleFailureMessage() was being passed a string. This adjusts the call to handleFailureMessage() to pass a byte array as well.