public static ErrorMessage from(com.yahoo.processing.request.ErrorMessage error) {
        if (error instanceof ErrorMessage) return (ErrorMessage)error;
        return new ErrorMessage(error.getCode(),error.getMessage(),error.getDetailedMessage(),error.getCause());
    }
Returns the given error message as this type. If it already is, this is a cast of the given instance.
Otherwise this creates a new instance having the same payload as the given instance.
container-search/src/main/java/com/yahoo/search/result/ErrorMessage.java