Skip to content

Commit 67f90fb

Browse files
authored
map grpc service busy error (#695)
1 parent 54d886c commit 67f90fb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/uber/cadence/internal/compatibility/thrift/ErrorMapper.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import com.uber.cadence.FeatureNotEnabledError;
2525
import com.uber.cadence.InternalDataInconsistencyError;
2626
import com.uber.cadence.InternalServiceError;
27+
import com.uber.cadence.LimitExceededError;
28+
import com.uber.cadence.ServiceBusyError;
2729
import com.uber.cadence.WorkflowExecutionAlreadyCompletedError;
2830
import com.uber.cadence.WorkflowExecutionAlreadyStartedError;
2931
import io.grpc.Metadata;
@@ -77,6 +79,14 @@ public static TException Error(StatusRuntimeException ex) {
7779
return e;
7880
}
7981
}
82+
case RESOURCE_EXHAUSTED:
83+
switch (details) {
84+
case "LimitExceededError":
85+
return new LimitExceededError(ex.getMessage());
86+
case "ServiceBusyError":
87+
return new ServiceBusyError(ex.getMessage());
88+
}
89+
8090
default:
8191
// If error does not match anything, return raw grpc status error
8292
// There are some code that casts error to grpc status to check for deadline exceeded status

0 commit comments

Comments
 (0)