Functional approach
Since Asset Picker does not initiate and manage the outgoing connections in case of Functional services, it cannot keep track of end to end success.
Hence, it provides certain standard exceptions, which the service implementations can throw to convey relevant failure conditions. These exceptions are related to communication with target content repository and are present within the com.hcl.unica.cms.integration.exception package.
- RepositoryNotFoundException
This exception must be used when the target system or content repository cannot be located. Alternatively,
java.net.UnknownHostException
can also be used. This exception is also conveyed as 404 HTTP response to the client. - ServiceNotFoundException
This exception must be used when the remote endpoint returns 404, or if the target service no longer exists. Absence of the target system and the absence of the required service are considered as different things. Hence, the
ServiceNotFoundException
conveys presence of the target system and the absence of the required service, or feature, on the target system. For example, in case of content fetched from the database, the absence of the required table (or the absence of the permission to access it) can be conveyed using this exception. This exception is also conveyed as 404 HTTP response to the client. - InaccessibleRepositoryException
This exception must be used to convey unreachable or inaccessible target systems, such as connection timeout. Alternatively,
java.net.ConnectException
can also be used. This exception is also conveyed as 503 HTTP response to the client. - SluggishRepositoryException
When the response from the target system is not received within expected time, this exception must be used to convey the slowness of the target system. Alternatively,
java.net.SocketTimeoutException
can also be used. This exception is also conveyed as 504 HTTP response to the client. - InternalRepositoryErrorException
This exception must be used if the plugin receives a temporary, or unexpected, error from the target system to convey the problems in it. This exception is also conveyed as 502 HTTP response to the client.
Any other exceptions are conveyed as 502 HTTP response to the client. In any case, the message in the exception is never returned to the client. Each HTTP response code carries a fixed, generic, and localized message.