{"record":{"id":"54391b7df3059d81","repo":"qishibo/AnotherRedisDesktopManager","slug":"err-message","errorCode":null,"errorMessage":"err.message","messagePattern":"err\\.message","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/CliTab.vue","lineNumber":283,"sourceCode":"          this.monitorInstance.on('monitor', (time, args, source, database) => {\n            this.scrollToBottom(`${time} [${database} ${source}] ${args.join(' ')}`);\n          });\n        });\n\n        return;\n      }\n\n      // normal command\n      const promise = this.anoClient.callBuffer(paramsArr[0], paramsArr.slice(1));\n\n      // normal command promise\n      promise.then((reply) => {\n        this.content.push(this.resolveResult(reply).trim());\n        this.execFinished(paramsArr);\n        this.scrollToBottom();\n      }).catch((err) => {\n        this.multiQueue = null;\n        this.scrollToBottom(err.message);\n      });\n    },\n    execFinished(params) {\n      const operate = params[0].toLowerCase();\n\n      if (operate === 'select' && !isNaN(params[1])) {\n        this.$bus.$emit('changeDb', this.anoClient, params[1]);\n      }\n\n      // operate may add new key, refresh left key list\n      if (['hmset', 'hset', 'lpush', 'rpush', 'set', 'sadd', 'zadd', 'xadd', 'json.set', 'arset', 'armset', 'arinsert', 'ts.add', 'ts.create'].includes(operate)) {\n        this.$bus.$emit('refreshKeyList', this.client, Buffer.from(params[1]), 'add');\n      }\n      if (['del'].includes(operate)) {\n        this.$bus.$emit('refreshKeyList', this.client, Buffer.from(params[1]), 'del');\n      }\n    },\n    scrollToBottom(append = '') {","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/CliTab.vue#L265-L301","documentation":"Generic catch for normal (non-queued) CLI commands executed via this.anoClient.callBuffer(command, args); the raw ioredis error message is echoed to the terminal. Any server error reply - WRONGTYPE, unknown command, wrong arity, NOAUTH, READONLY, OOM - or a broken connection lands here. The handler also sets multiQueue = null, aborting any open transaction.","triggerScenarios":"Running a command against the wrong key type (GET on a hash -> WRONGTYPE), a misspelled or unloaded command (module commands on a stock server), wrong arity (LPUSH key with no values), writing to a read-only replica, or issuing commands after the connection dropped.","commonSituations":"Exploring unfamiliar keys from the CLI, using module commands against a server without the module, forgetting the current SELECT db or key types.","solutions":["Read the echoed message - Redis states the exact problem (type, arity, auth, readonly)","Confirm the key's type with TYPE key before type-specific commands","Check spelling and argument count (TAB completion / COMMAND DOCS)","Ensure the target is a writable master and the connection is authenticated"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// cheap pre-checks before executing a typed command\nconst type = await client.type(key);\nif (commandRequiresString(cmd) && type !== 'string') {\n  echo(`WRONGTYPE - key is ${type}`);\n  return;\n}","typeGuard":null,"tryCatchPattern":"// echo the raw message and keep transaction state consistent\ntry {\n  const reply = await callBuffer(cmd, args);\n  echo(format(reply));\n} catch (err) {\n  this.multiQueue = null; // failed command aborts the local queue\n  echo(err.message);       // ioredis message already carries the server's text\n}","preventionTips":["TYPE key before type-specific commands (GET/LPUSH/HGET expectations differ)","Use TAB completion to avoid misspelled commands and wrong arity","Confirm module commands exist on the server (COMMAND EXISTS) before using them"],"tags":["redis","cli","ioredis","wrongtype","ardm"],"backgroundTag":"redis-command-error","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}