I would do the error similarly here:

    errMsg = 'Expression ' + (idx + 1) + ': Result type "' + data.Type + '" cannot be graphed.";