{"version":"2.1.285","anchor":"result-messages-can-carry-error-code","canonical_anchor":"result-messages-can-carry-error-code","heading":"Error results can now include an error code","tier":"notice","area":"SDK","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285\/e\/result-messages-can-carry-error-code","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285","markdown":"### Error results can now include an error code\n\nWhen a run ends in an error, the result message can now carry an `error_code` field if the error is one Claude Code recognises\n\n**Unclear.** Which error codes are on the known list, and so when the field appears, is not stated.\n\n**What**\n\nWhen Claude Code finishes a run with an error, it sends a result message saying how the run ended. Programs that drive Claude Code through the SDK read this message. The SDK is the toolkit for using Claude Code from your own code.\n\nThat error result used to carry only a subtype and the error text. It can now also carry an `error_code` field. The field appears only when the error matches one of the codes Claude Code knows about.\n\n**Why**\n\nIf you build on the SDK, your program can check a fixed code and decide what to do next. It no longer has to match the wording of the error text.\n\n- Area: SDK\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5"}