@@ -2129,14 +2129,25 @@ func (ms *MutableStateImpl) IsTransientWorkflowTask() bool {
21292129
21302130func (ms * MutableStateImpl ) ClearTransientWorkflowTask () error {
21312131 if ! ms .HasStartedWorkflowTask () {
2132- return serviceerror .NewInternal ("cannot clear transient workflow task when task is missing" )
2132+ return softassert .UnexpectedInternalErr (
2133+ ms .logger ,
2134+ "cannot clear transient workflow task when task is missing" ,
2135+ nil ,
2136+ )
21332137 }
21342138 if ! ms .IsTransientWorkflowTask () {
2135- return serviceerror .NewInternal ("cannot clear transient workflow task when task is not transient" )
2139+ return softassert .UnexpectedInternalErr (
2140+ ms .logger ,
2141+ "cannot clear transient workflow task when task is not transient" ,
2142+ nil ,
2143+ )
21362144 }
2137- // this is transient workflow task
21382145 if ms .HasBufferedEvents () {
2139- return serviceerror .NewInternal ("cannot clear transient workflow task when there are buffered events" )
2146+ return softassert .UnexpectedInternalErr (
2147+ ms .logger ,
2148+ "cannot clear transient workflow task when there are buffered events" ,
2149+ nil ,
2150+ )
21402151 }
21412152 // no buffered event
21422153 emptyWorkflowTaskInfo := & historyi.WorkflowTaskInfo {
@@ -6333,7 +6344,11 @@ func (ms *MutableStateImpl) CloseTransactionAsSnapshot(
63336344
63346345 if len (result .bufferEvents ) > 0 {
63356346 // TODO do we need the functionality to generate snapshot with buffered events?
6336- return nil , nil , serviceerror .NewInternal ("cannot generate workflow snapshot with buffered events" )
6347+ return nil , nil , softassert .UnexpectedInternalErr (
6348+ ms .logger ,
6349+ "cannot generate workflow snapshot with buffered events" ,
6350+ nil ,
6351+ )
63376352 }
63386353
63396354 workflowSnapshot := & persistence.WorkflowSnapshot {
@@ -7017,7 +7032,11 @@ func (ms *MutableStateImpl) closeTransactionPrepareReplicationTasks(
70177032
70187033 if transactionPolicy == historyi .TransactionPolicyPassive &&
70197034 len (ms .InsertTasks [tasks .CategoryReplication ]) > 0 {
7020- return serviceerror .NewInternal ("should not generate replication task when close transaction as passive" )
7035+ return softassert .UnexpectedInternalErr (
7036+ ms .logger ,
7037+ "should not generate replication task when close transaction as passive" ,
7038+ nil ,
7039+ )
70217040 }
70227041
70237042 return nil
0 commit comments