[BUG] system.db.clearNamedQueryCache doesn't raise exception for invalid path

Title.

This function also seems to have a void return so there is no feedback whatsoever on whether this function executed successfully or whether any cache was actually cleared.

According to the javadoc, this function should throw a GatewayException if the path is malformed, but it does not.

Tested in browser from a perspective view:

def runAction(self, event):
	system.perspective.print("start test")
	from java.lang import Throwable
	
	try:
		ret = system.db.clearNamedQueryCache(path = "blablabla")
		system.perspective.print("ret: %s" % (repr(ret)))
	except Throwable as t:
		system.perspective.print("caught Throwable: %s" % (repr(t)))
	except Exception as e:
		system.perspective.print("caught Exception: %s" % (repr(e)))
	
	system.perspective.print("end test")
	self.props.value = 0

Expected output: "caught Throwable"

Acutal output:

View JSON
{
  "custom": {},
  "params": {},
  "props": {
    "defaultSize": {
      "height": 500,
      "width": 700
    }
  },
  "root": {
    "children": [
      {
        "meta": {
          "name": "TextArea"
        },
        "position": {
          "basis": "160px",
          "grow": 1
        },
        "props": {
          "text": "---\nNone\n---\n"
        },
        "type": "ia.input.text-area"
      },
      {
        "events": {
          "component": {
            "onActionPerformed": {
              "config": {
                "script": "\tsystem.perspective.print(\"start test\")\n\tfrom java.lang import Throwable\n\t\n\ttry:\n\t\tret \u003d system.db.clearNamedQueryCache(path \u003d \"blablabla\")\n\t\tsystem.perspective.print(\"ret: %s\" % (repr(ret)))\n\texcept Throwable as t:\n\t\tsystem.perspective.print(\"caught Throwable: %s\" % (repr(t)))\n\texcept Exception as e:\n\t\tsystem.perspective.print(\"caught Exception: %s\" % (repr(e)))\n\t\n\tsystem.perspective.print(\"end test\")\n\tself.props.value \u003d 0\n\t"
              },
              "scope": "G",
              "type": "script"
            }
          }
        },
        "meta": {
          "name": "OneShotButton"
        },
        "position": {
          "basis": "34px"
        },
        "props": {
          "readyState": {
            "icon": {
              "style": {
                "height": "24px",
                "width": "2rem"
              }
            },
            "text": "Run"
          },
          "writingState": {
            "icon": {
              "path": "material/hourglass_empty",
              "style": {
                "height": "24px",
                "width": "2rem"
              }
            },
            "text": "Busy..."
          }
        },
        "type": "ia.input.oneshotbutton"
      }
    ],
    "meta": {
      "name": "root"
    },
    "props": {
      "direction": "column"
    },
    "type": "ia.container.flex"
  }
}

Try with path as a positional parameter. The docs do not say that this function accepts keyword parameters.

Good suggestion but alas, it has no effect. It produces the exact same result as above. I don't think I've ever had problems passing keyword arguments to system.db functions.

Oh, well.

( A lot of older functions do not play well with keyword arguments. )

Yeah. The docs/function are just wrong; maybe the implementation changed over time and nobody caught it, but it's not going to throw if you pass it garbage. Unfortunately, it's void all the way down, even the internal Java methods, so there's nothing for the scripting function to return either.