Skip to content

Commit 33bce86

Browse files
akshaywadiaAkshay Wadia
andauthored
Adding Error API (#21)
Co-authored-by: Akshay Wadia <awadia@apple.com>
1 parent 5efc91e commit 33bce86

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

apple/swift_homomorphic_encryption/api/pir/v1/api.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,38 @@ message Response {
8686
}
8787
reserved 2;
8888
}
89+
90+
// Error returned by failed API calls.
91+
message Error {
92+
// Client configuration not found.
93+
//
94+
// Client should retry after fetching new configuration. May include new configuration
95+
// in `config_response`. In this case, client should use this returned configuration and retry.
96+
message ConfigVersionNotFound {
97+
// ConfigResponse that client should use for subsequent requests.
98+
optional ConfigResponse config_response = 1;
99+
}
100+
101+
// Evaluation key not found.
102+
//
103+
// Client should upload evaluation key and retry.
104+
message EvaluationKeyNotFound {}
105+
106+
// Request can not be parsed successfully.
107+
message InvalidRequest {}
108+
109+
// Internal error.
110+
message InternalError {}
111+
112+
// Type of error encountered while processing request.
113+
oneof error_type {
114+
// Client configuration not found.
115+
ConfigVersionNotFound config_version_not_found = 1;
116+
// Client evaluation key not found.
117+
EvaluationKeyNotFound evaluation_key_not_found = 2;
118+
// Request can not be parsed.
119+
InvalidRequest invalid_request = 3;
120+
// Internal error.
121+
InternalError internal_error = 4;
122+
}
123+
}

apple/swift_homomorphic_encryption/api/pnns/v1/api.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,38 @@ message Response {
8484
}
8585
reserved 3;
8686
}
87+
88+
// Error returned by failed API calls.
89+
message Error {
90+
// Client configuration not found.
91+
//
92+
// Client should retry after fetching new configuration. May include new configuration
93+
// in `config_response`. In this case, client should use this returned configuration and retry.
94+
message ConfigVersionNotFound {
95+
// ConfigResponse that client should use for subsequent requests.
96+
optional ConfigResponse config_response = 1;
97+
}
98+
99+
// Evaluation key not found.
100+
//
101+
// Client should upload evaluation key and retry.
102+
message EvaluationKeyNotFound {}
103+
104+
// Request can not be parsed successfully.
105+
message InvalidRequest {}
106+
107+
// Internal error.
108+
message InternalError {}
109+
110+
// Type of error encountered while processing request.
111+
oneof error_type {
112+
// Client configuration not found.
113+
ConfigVersionNotFound config_version_not_found = 1;
114+
// Client evaluation key not found.
115+
EvaluationKeyNotFound evaluation_key_not_found = 2;
116+
// Request can not be parsed.
117+
InvalidRequest invalid_request = 3;
118+
// Internal error.
119+
InternalError internal_error = 4;
120+
}
121+
}

apple/swift_homomorphic_encryption/api/v1/api.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,38 @@ message Response {
9090
apple.swift_homomorphic_encryption.api.pir.v1.OPRFResponse oprf_response = 3;
9191
}
9292
}
93+
94+
// Error returned by failed API calls.
95+
message Error {
96+
// Client configuration not found.
97+
//
98+
// Client should retry after fetching new configuration. May include new configuration
99+
// in `config_response`. In this case, client should use this returned configuration and retry.
100+
message ConfigVersionNotFound {
101+
// ConfigResponse that client should use for subsequent requests.
102+
optional ConfigResponse config_response = 1;
103+
}
104+
105+
// Evaluation key not found.
106+
//
107+
// Client should upload evaluation key and retry.
108+
message EvaluationKeyNotFound {}
109+
110+
// Request can not be parsed successfully.
111+
message InvalidRequest {}
112+
113+
// Internal error.
114+
message InternalError {}
115+
116+
// Type of error encountered while processing request.
117+
oneof error_type {
118+
// Client configuration not found.
119+
ConfigVersionNotFound config_version_not_found = 1;
120+
// Client evaluation key not found.
121+
EvaluationKeyNotFound evaluation_key_not_found = 2;
122+
// Request can not be parsed.
123+
InvalidRequest invalid_request = 3;
124+
// Internal error.
125+
InternalError internal_error = 4;
126+
}
127+
}

0 commit comments

Comments
 (0)