From e43e77eca842868aacb1047992ce1ef98c3a53de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20L=C3=ADzner?= Date: Tue, 18 Nov 2025 15:43:52 +0100 Subject: [PATCH] Clarify connector guide in executeQuery exceptions --- .../connid/1.x/connector-development-guide/index.adoc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/connectors/connid/1.x/connector-development-guide/index.adoc b/connectors/connid/1.x/connector-development-guide/index.adoc index e7d1d31e..33e7a453 100644 --- a/connectors/connid/1.x/connector-development-guide/index.adoc +++ b/connectors/connid/1.x/connector-development-guide/index.adoc @@ -1304,14 +1304,9 @@ Errors that are not harmful to the system and origin from data inconsistency (e. The normal behavior of the `executeQuery(...)` operation is to return all the objects that satisfy the query. If there is no such object than the `executeQuery(...)` should not return any object (i.e. do not invoke the handler). -But *the executeQuery(...) operation should not indicate any error* in this case. -It should not throw any exception. -MidPoint will see empty result set and it will figure out that there is no such object. - -However, there are (quite rare) cases when the search should throw UnknownUidException. -One such case is when the container (base context) option is present in the operation arguments and the container object is not found. -Then the search query cannot be executed and in fact we do not know whether the search objects exist or not. -This condition is indicated by throwing UnknownUidException and this case should be interpreted differently than not returning any results at all. +In other words, *the executeQuery(...) operation should not throw any exception in case object was not found on the resource.* MidPoint will see empty result set and it will figure out that there is no such object. + +However, there are situations in which the `executeQuery(...)` should throw exceptions. It may throw exceptions such as ConnectionBrokenException or ConnectionFailedException if the resource returns an error during the query operation. A rarer case is UnknownUidException: this can occur when the container (base context) option is present in the operation arguments but the container object cannot be found. In such a situation, the search query cannot be executed, and we cannot determine whether the target objects exist. This condition is indicated by throwing UnknownUidException, and it should be interpreted differently from simply returning no results. === Search and Filter Translation