{"record":{"id":"7ffcae60f321bdd1","repo":"filp/whoops","slug":"invalid-status-code-code-must-be-4xx-or-5xx","errorCode":null,"errorMessage":"Invalid status code '$code', must be 4xx or 5xx","messagePattern":"Invalid status code '\\$code', must be 4xx or 5xx","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Whoops/Run.php","lineNumber":321,"sourceCode":"     *\n     * @throws InvalidArgumentException\n     */\n    public function sendHttpCode($code = null)\n    {\n        if (func_num_args() == 0) {\n            return $this->sendHttpCode;\n        }\n\n        if (!$code) {\n            return $this->sendHttpCode = false;\n        }\n\n        if ($code === true) {\n            $code = 500;\n        }\n\n        if ($code < 400 || 600 <= $code) {\n            throw new InvalidArgumentException(\n                \"Invalid status code '$code', must be 4xx or 5xx\"\n            );\n        }\n\n        return $this->sendHttpCode = $code;\n    }\n\n    /**\n     * Should Whoops exit with a specific code on the CLI if possible?\n     * Whoops will exit with 1 by default, but you can specify something else.\n     *\n     * @param int $code\n     *\n     * @return int\n     *\n     * @throws InvalidArgumentException\n     */\n    public function sendExitCode($code = null)","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Run.php#L303-L339","documentation":"Error \"Invalid status code '$code', must be 4xx or 5xx\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Run.php:321 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7","analyzedAt":"2026-08-21T01:30:26.400Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}