500 Internal Server error for nonexistent data partitions
While making calls to OSDU services, e.g., storage service, the users are getting a 500 internal server error if they provide a nonexistent data partition id. Technically, as the input is wrong from the user side some sort of 4xx error should have been returned.
Upon debugging I found that the issue is occurring when featureFlag.strategy=dataPartition. The following is the code from where 500 AppException is being returned if a data partition is not found. https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/blob/master/src/main/java/org/opengroup/osdu/core/common/feature/PartitionFeatureFlagImpl.java?ref_type=heads#L52
Is 500 internal server error a expected response in this case as its not the service fault rather a wrong input provided by the user?