diff --git a/apple/swift_homomorphic_encryption/api/pir/v1/api.proto b/apple/swift_homomorphic_encryption/api/pir/v1/api.proto index 09c2442..05a906a 100644 --- a/apple/swift_homomorphic_encryption/api/pir/v1/api.proto +++ b/apple/swift_homomorphic_encryption/api/pir/v1/api.proto @@ -86,3 +86,38 @@ message Response { } reserved 2; } + +// Error returned by failed API calls. +message Error { + // Client configuration not found. + // + // Client should retry after fetching new configuration. May include new configuration + // in `config_response`. In this case, client should use this returned configuration and retry. + message ConfigVersionNotFound { + // ConfigResponse that client should use for subsequent requests. + optional ConfigResponse config_response = 1; + } + + // Evaluation key not found. + // + // Client should upload evaluation key and retry. + message EvaluationKeyNotFound {} + + // Request can not be parsed successfully. + message InvalidRequest {} + + // Internal error. + message InternalError {} + + // Type of error encountered while processing request. + oneof error_type { + // Client configuration not found. + ConfigVersionNotFound config_version_not_found = 1; + // Client evaluation key not found. + EvaluationKeyNotFound evaluation_key_not_found = 2; + // Request can not be parsed. + InvalidRequest invalid_request = 3; + // Internal error. + InternalError internal_error = 4; + } +} diff --git a/apple/swift_homomorphic_encryption/api/pnns/v1/api.proto b/apple/swift_homomorphic_encryption/api/pnns/v1/api.proto index 27ede72..aca9ac5 100644 --- a/apple/swift_homomorphic_encryption/api/pnns/v1/api.proto +++ b/apple/swift_homomorphic_encryption/api/pnns/v1/api.proto @@ -84,3 +84,38 @@ message Response { } reserved 3; } + +// Error returned by failed API calls. +message Error { + // Client configuration not found. + // + // Client should retry after fetching new configuration. May include new configuration + // in `config_response`. In this case, client should use this returned configuration and retry. + message ConfigVersionNotFound { + // ConfigResponse that client should use for subsequent requests. + optional ConfigResponse config_response = 1; + } + + // Evaluation key not found. + // + // Client should upload evaluation key and retry. + message EvaluationKeyNotFound {} + + // Request can not be parsed successfully. + message InvalidRequest {} + + // Internal error. + message InternalError {} + + // Type of error encountered while processing request. + oneof error_type { + // Client configuration not found. + ConfigVersionNotFound config_version_not_found = 1; + // Client evaluation key not found. + EvaluationKeyNotFound evaluation_key_not_found = 2; + // Request can not be parsed. + InvalidRequest invalid_request = 3; + // Internal error. + InternalError internal_error = 4; + } +} diff --git a/apple/swift_homomorphic_encryption/api/v1/api.proto b/apple/swift_homomorphic_encryption/api/v1/api.proto index c483867..e75b07a 100644 --- a/apple/swift_homomorphic_encryption/api/v1/api.proto +++ b/apple/swift_homomorphic_encryption/api/v1/api.proto @@ -90,3 +90,38 @@ message Response { apple.swift_homomorphic_encryption.api.pir.v1.OPRFResponse oprf_response = 3; } } + +// Error returned by failed API calls. +message Error { + // Client configuration not found. + // + // Client should retry after fetching new configuration. May include new configuration + // in `config_response`. In this case, client should use this returned configuration and retry. + message ConfigVersionNotFound { + // ConfigResponse that client should use for subsequent requests. + optional ConfigResponse config_response = 1; + } + + // Evaluation key not found. + // + // Client should upload evaluation key and retry. + message EvaluationKeyNotFound {} + + // Request can not be parsed successfully. + message InvalidRequest {} + + // Internal error. + message InternalError {} + + // Type of error encountered while processing request. + oneof error_type { + // Client configuration not found. + ConfigVersionNotFound config_version_not_found = 1; + // Client evaluation key not found. + EvaluationKeyNotFound evaluation_key_not_found = 2; + // Request can not be parsed. + InvalidRequest invalid_request = 3; + // Internal error. + InternalError internal_error = 4; + } +}