private static Exception GetCause(byte[] serializedCause, string originalTaskExceptionToString) { // TODO[JIRA REEF-1422]: Distinguish between Java Task Exception and missing Exception. if (ByteUtilities.IsNullOrEmpty(serializedCause)) { return(new TaskExceptionMissingException( "Task failed without an Exception, presumably caused by an Exception failure. Please inspect the FailedTask message.")); } try { return((Exception)ByteUtilities.DeserializeFromBinaryFormat(serializedCause)); } catch (SerializationException se) { return(NonSerializableTaskException.UnableToDeserialize(originalTaskExceptionToString, se)); } }