[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Raise errors\n\nYou can raise custom errors using the `raise` syntax, and you can catch and\nhandle errors using a\n[`try/except` block](/workflows/docs/reference/syntax/catching-errors).\n\nErrors can be either a string or a map. You can use user-defined keys: \n\n### YAML\n\n```yaml\n - STEP_NAME:\n raise:\n KEY_1: VALUE_1\n KEY_2: VALUE_2\n```\n\n### JSON\n\n```json\n [\n {\n \"\u003cvar translate=\"no\"\u003eSTEP_NAME\u003c/var\u003e\": {\n \"raise\": {\n \"\u003cvar translate=\"no\"\u003eKEY_1\u003c/var\u003e\": \"\u003cvar translate=\"no\"\u003eVALUE_1\u003c/var\u003e\",\n \"\u003cvar translate=\"no\"\u003eKEY_2\u003c/var\u003e\": \"\u003cvar translate=\"no\"\u003eVALUE_2\u003c/var\u003e\"\n }\n }\n }\n ]\n```\n\nExamples\n--------\n\n**String** \n\n### YAML\n\n```yaml\n - step_a:\n raise: \"Something went wrong.\"\n```\n\n### JSON\n\n```json\n [\n {\n \"step_a\": {\n \"raise\": \"Something went wrong.\"\n }\n }\n ]\n```\n\n**Map** \n\n### YAML\n\n```yaml\n - step_a:\n raise:\n code: 55\n message: \"Something went wrong.\"\n```\n\n### JSON\n\n```json\n [\n {\n \"step_a\": {\n \"raise\": {\n \"code\": 55,\n \"message\": \"Something went wrong.\"\n }\n }\n }\n ]\n```\n\nWhat's next\n-----------\n\n- [Workflow errors](/workflows/docs/reference/syntax/error-types)\n- [Catch errors](/workflows/docs/reference/syntax/catching-errors)\n- [Retry steps](/workflows/docs/reference/syntax/retrying)"]]