{
  "algorithm": {
    "parameters": [
      {
        "name": "err",
        "type": "Error"
      },
      {
        "name": "httpRequest",
        "type": "HttpRequest"
      },
      {
        "name": "httpResponse",
        "type": "HttpResponse"
      }
    ],
    "statements": [
      {
        "children": [
          {
            "command": "Set",
            "expression": "401",
            "variableName": "httpResponse.status"
          }
        ],
        "command": "If",
        "expression": "err.code == \"UnAuthorized\" || err.code == \"TokenExpired\""
      },
      {
        "children": [
          {
            "command": "Set",
            "expression": "500",
            "variableName": "httpResponse.status"
          },
          {
            "command": "Set",
            "expression": "JsonStringify(^err)",
            "variableName": "httpResponse.body"
          }
        ],
        "command": "Else"
      }
    ],
    "typeReturn": "any",
    "variables": []
  }
}