From 2590c476c81ac83aaef02965d5923bdc25556d7c Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Thu, 13 Apr 2023 23:29:29 +0300 Subject: [PATCH] adds most of the provider errors --- src/utils/ProviderErrors.ts | 41 +++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/utils/ProviderErrors.ts b/src/utils/ProviderErrors.ts index 6416a194..38fba3a2 100644 --- a/src/utils/ProviderErrors.ts +++ b/src/utils/ProviderErrors.ts @@ -3,12 +3,36 @@ const PREDEFINED_ERRORS = { invalid: 'Datasets is not a list, as expected' }, algorithm: { + serviceId: { + missing: 'The serviceId key is missing from the algorithm s DDO.', + not_found: 'The provided serviceId does not exist.', + service_not_access_compute: 'Service type is neither access, nor compute.', + main_service_compute: + 'If the main service is not compute for this asset when calling initialize endpoint.', + compute_services_not_in_same_provider: + 'Files attached to the compute service are not decrypted by the correct provider. This occurs when both asset and algorithm are requested by their compute service which cannot be decrypted by a single provider as how it is supposed to be.' + }, + container: { + checksum_prefix: 'Container checksum does not start with the prefix sha256:.', + mising_entrypoint_image_checksum: + 'Either entrypoint, either image, or either checksum are missing from the container dictionary from the algorithm s DDO.' + }, + documentId: { + did_not_found: + 'The algorithm s DID could not be retrieved from the metadata store, because the algorithm asset does not exist.', + missing: 'The documentId key is missing from the algorithm s DDO.' + }, + transferTxId: { + missing: 'The transferTxId key is missing from the algorithm s DDO.' + }, missing_meta_documentId: 'Either algorithm metadata, or algorithm DID are missing.', did_not_found: 'Either algorithm metadata, or algorithm DID are missing.', not_algo: 'Either algorithm metadata, or algorithm DID are missing.', in_use_or_not_on_chain: 'Either algorithm metadata, or algorithm DID are missing.', meta_oneof_url_rawcode_remote: - 'Either algorithm metadata, or algorithm DID are missing.' + 'Either algorithm metadata, or algorithm DID are missing.', + file_unavailable: + 'One possibility is that the asset could not be retrieved from Aquariuss database. Otherwise, there are issues related to services' }, error: { not_trusted_algo_publisher: @@ -30,10 +54,23 @@ const PREDEFINED_ERRORS = { 'Either the algorithm assets DID is incorrectly typed, either the algorithm timeout expired.', 'Compute environment does not exist.': 'The compute environment provided by the user does not exist, it is not served by our compute-to-data feature. The user can use get_c2d_environments to check the list of available compute environments.', - 'The validUntil value is not correct.': 'validUntil value is most probably expired.' + 'The validUntil value is not correct.': 'validUntil value is most probably expired.', + 'Cannot resolve DID': 'The dataset DID does not exist in the Metadata store.', + 'Invalid serviceId': 'The serviceId of that dataset is not correct.', + 'Unable to get dataset files': + 'The files of that dataset could not be decrypted or retrieved', + 'cannot decrypt files for this service.': + 'The files of that dataset could not be decrypted due to the fact that file object, which contains the structure and the type of specific file, is missing from the validation part.', + 'Unsupported type ': 'The file object type is not supported by Provider.', + 'malformed file object': + 'The file object structure is invalid and does not contain the wanted information for the specific file.' }, order: { fees_not_paid: ' Provider fees are not paid.' + }, + output: { + invalid: + 'The algorithms validation after the build stage has not been decoded properly as a dictionary.' } }