Skip to content

Commit fc2715c

Browse files
authored
Merge pull request #289 from code0-tech/feat/#279
Adjust Interface to new RuntimeError Strategy
2 parents 6197159 + e2dd973 commit fc2715c

5 files changed

Lines changed: 24 additions & 15 deletions

File tree

proto/sagittarius/sagittarius.module.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ message ModuleUpdateRequest {
1717
message ModuleUpdateResponse {
1818
// True if was successful, false if not
1919
bool success = 1;
20-
optional shared.Error error = 2;
20+
optional shared.ServiceError error = 2;
2121
}
2222

2323
//This service will be implemented as a server by Sagittarius and as a client by Aquila.

proto/sagittarius/sagittarius.runtime_status.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ message RuntimeStatusUpdateRequest {
1717

1818
message RuntimeStatusUpdateResponse {
1919
bool success = 1;
20-
optional shared.Error error = 2;
20+
optional shared.ServiceError error = 2;
2121
}
2222

2323
service RuntimeStatusService {

proto/sagittarius/sagittarius.runtime_usage.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ message RuntimeUsageRequest {
1313

1414
message RuntimeUsageResponse {
1515
bool success = 1;
16-
optional shared.Error error = 2;
16+
optional shared.ServiceError error = 2;
1717
}
1818

1919
service RuntimeUsageService {

proto/shared/shared.errors.proto

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,31 @@ package shared;
44

55
option ruby_package = "Tucana::Shared";
66

7-
message Error {
7+
import "shared.struct.proto";
8+
9+
message ServiceError {
810
string message = 1;
9-
repeated ErrorDetails details = 2;
11+
repeated ServiceErrorDetails details = 2;
1012
}
1113

12-
message ErrorDetails {
14+
message ServiceErrorDetails {
1315
oneof kind {
14-
ActiveModelError active_model_error = 1;
16+
ServiceActiveModelError active_model_error = 1;
1517
}
1618
}
1719

18-
message ActiveModelError {
20+
message ServiceActiveModelError {
1921
string attribute = 1;
2022
string type = 2;
2123
}
24+
25+
message Error {
26+
string code = 1; //e.g. T-STD-000123
27+
string category = 2; //e.g. InvalidArgument
28+
string message = 3; //e.g. Expected number as argument but received list
29+
int64 timestamp = 4; // epoch timestamp in milliseconds
30+
string version = 5; // version of service which produced the error
31+
map<string, string> dependencies = 6;
32+
shared.Struct details = 7;
33+
34+
}

proto/shared/shared.execution_result.proto

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@ package shared;
55
option ruby_package = "Tucana::Shared";
66

77
import "shared.struct.proto";
8+
import "shared.errors.proto";
89

910
message NodeParameterNodeExecutionResult {
1011
shared.Value value = 5;
1112
}
1213

13-
message RuntimeError {
14-
string code = 1;
15-
optional string description = 2;
16-
}
17-
1814
message NodeExecutionResult {
1915

2016
int64 node_id = 1;
@@ -25,7 +21,7 @@ message NodeExecutionResult {
2521

2622
oneof result {
2723
shared.Value success = 5;
28-
RuntimeError error = 6;
24+
shared.Error error = 6;
2925
}
3026

3127
}
@@ -43,7 +39,7 @@ message ExecutionResult {
4339
// Result of executed flow
4440
oneof result {
4541
shared.Value success = 7;
46-
RuntimeError error = 8;
42+
shared.Error error = 8;
4743
}
4844

4945
}

0 commit comments

Comments
 (0)