function isUnknownCommand(err) {
    if (!err || typeof err !== 'object') {
        return false;
    }

    /**
     * when running browser driver directly
     */
    if (err.message.match(/(did not match a known command|unknown command)/)) {
        return true;
    }

    /**
     * when running via selenium standalone
     */
    if (err.seleniumStack && err.seleniumStack.type === 'UnknownCommand') {
        return true;
    }

    return false;
}
that has no error property (Appium only)