{"record":{"id":"e4da0f42382ce245","repo":"gchq/CyberChef","slug":"unsupported-output-ip-format","errorCode":null,"errorMessage":"Unsupported output IP format","messagePattern":"Unsupported output IP format","errorType":"exception","errorClass":"OperationError","httpStatus":null,"severity":"error","filePath":"src/core/operations/ChangeIPFormat.mjs","lineNumber":113,"sourceCode":"                    output += ddIp.slice(0, ddIp.length-1) + \"\\n\";\n                    break;\n                case \"Decimal\":\n                    decIp = ((baIp[0] << 24) | (baIp[1] << 16) | (baIp[2] << 8) | baIp[3]) >>> 0;\n                    output += decIp.toString() + \"\\n\";\n                    break;\n                case \"Octal\":\n                    decIp = ((baIp[0] << 24) | (baIp[1] << 16) | (baIp[2] << 8) | baIp[3]) >>> 0;\n                    output += \"0\" + decIp.toString(8) + \"\\n\";\n                    break;\n                case \"Hex\":\n                    hexIp = \"\";\n                    for (j = 0; j < baIp.length; j++) {\n                        hexIp += Utils.hex(baIp[j]);\n                    }\n                    output += hexIp + \"\\n\";\n                    break;\n                default:\n                    throw new OperationError(\"Unsupported output IP format\");\n            }\n        }\n\n        return output.slice(0, output.length-1);\n    }\n\n    /**\n     * Constructs an array of IP address octets from a numerical value.\n     * @param {string} value The value of the IP address\n     * @param {number} radix The numeral system to be used\n     * @returns {number[]}\n     */\n    fromNumber(value, radix) {\n        const decimal = parseInt(value, radix);\n        const baIp = [];\n        baIp.push(decimal >> 24 & 255);\n        baIp.push(decimal >> 16 & 255);\n        baIp.push(decimal >> 8 & 255);","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/gchq/CyberChef/blob/4290ea753912378913b1f3f54e0fc5720afeda5d/src/core/operations/ChangeIPFormat.mjs#L95-L131","documentation":"Thrown in the output-format switch default case: the selected output IP format string matched none of the handled cases. Like the input error, this is an argument-configuration error — outFormat is an unrecognized enumerated value — independent of the actual IP data.","triggerScenarios":"ChangeIPFormat.run switches on outFormat over the supported output formats; if outFormat is undefined, misspelled, or not in the set, default throws while converting the first successfully-parsed IP.","commonSituations":"outFormat set to a non-canonical string ('octal' lowercase, 'binary', 'integer'), undefined from a missing arg slot, or a stale recipe referencing a removed format option.","solutions":["Set outFormat to exactly one supported enumerated value with correct casing (e.g. 'Dotted Decimal', 'Hex', 'Octal', 'Decimal').","Derive option strings from the operation's args metadata, not hand-typed literals.","Regenerate the recipe if the operation's option set changed."],"exampleFix":"// before\n// outFormat: \"binary\"   // not a supported output\n// after\n// outFormat: \"Hex\"","handlingStrategy":"validation","validationCode":"const VALID_OUT_FORMATS = [\"Dotted Decimal\", \"Hex\", \"Decimal\", \"Octal\" /* + others per args def */];\nif (!VALID_OUT_FORMATS.includes(outFormat)) { /* reject */ }","typeGuard":"function isKnownOutFormat(f) { return VALID_OUT_FORMATS.includes(f); }","tryCatchPattern":"null","preventionTips":["Match outFormat exactly to a supported enumerated string (correct case).","Source option strings from operation metadata, not literals.","Rebuild recipes when an operation's option set changes."],"tags":["ip-format","network","config","switch-default"],"backgroundTag":null,"analyzedSha":"4290ea753912378913b1f3f54e0fc5720afeda5d","analyzedAt":"2026-08-13T06:05:50.210Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}