{
  "Guid": "2yYIcMC5QkWmrbaTSczVmA",
  "Document": {
    "Description": "Deprecated: Prefer standard JavaScript `throw new Error(...)`. Throws a validation error if condition is false. Handy to use for validating arguments in an API function.\n\nNote: This function should only be used when you need to return a specific result code. In most cases it is recommended to use `throw new Error(...)` instead.",
    "SortOrder": "",
    "API": true,
    "HashExample": false,
    "JsExample": true,
    "Keyword": false,
    "Options": false,
    "ROWID": "e8a02b32-37c5-39e2-0207-e7a4787c468b",
    "Expand": true,
    "Parameters": [
      {
        "Parameter": "description",
        "Type": "string",
        "Optional": false,
        "Description": "Text to throw as exception if condition is evaluated as \"false\".",
        "ROWID": "3330d70a-cb16-1596-c30e-18d195ae7181"
      },
      {
        "Parameter": "resultCode",
        "Type": "int",
        "Optional": true,
        "Description": "Code to include in the result JSON.",
        "ROWID": "e2bf45e4-d80b-5247-c496-d3e6b9f02c2a"
      }
    ],
    "Parameters_type": "Parameters",
    "Returns": "Throws a validation exception with description as text if condition evaluates to false.",
    "Data": "",
    "Code": "",
    "SpecifyOutput": false,
    "Output": "",
    "JsCode": "// If request.name is null or empty string it will return\n// an error 101 with specified Message and ResultCode\nif (!request.name)\n    docly.assert(\"Name must be specified\", 101);\n    \n// Always throw assert result, default ResultCode = 1\ndocly.assert(\"Name must be specified\");\n\n// Same as (recommended syntax):\nthrow new Error(\"Name must be specified\");",
    "RelatedLinks": [
      {
        "Description": "isNotNull",
        "Link": "~isNotNull",
        "ROWID": "b2c00012-0001-0001-0001-000000000001"
      },
      {
        "Description": "isString",
        "Link": "~isString",
        "ROWID": "b2c00012-0001-0001-0001-000000000002"
      },
      {
        "Description": "isNumber",
        "Link": "~isNumber",
        "ROWID": "b2c00012-0001-0001-0001-000000000003"
      },
      {
        "Description": "isEmail",
        "Link": "~isEmail",
        "ROWID": "b2c00012-0001-0001-0001-000000000004"
      }
    ],
    "RelatedLinks_type": "RelatedLinks",
    "OKCount": "2",
    "PassedCount": "0",
    "FailedCount": "0",
    "TotalCount": "2",
    "RemainCount": "0"
  },
  "EmbeddedFiles": [],
  "Schema": "Docly function",
  "Tags": [],
  "Modified": "2026-06-25T21:52:36.8551916+02:00",
  "Created": "2022-12-08T11:18:00.4382936+01:00"
}