Skip to main content

Debugging our Code

Let’s go ahead and fix the error in our Activity code by removing the thrown error or commenting it out and re-running our code to register the code change.

In practice, your code will continue retrying until whatever issue the Activity has encountered has resolved itself, whether that is the network coming back online or an internal service starting to respond again.

By leveraging the durability of Temporal and out of the box retry capabilities, you have avoided writing retry and timeout logic yourself and saved your downstream services from being unnecessarily overwhelmed.

func WithdrawMoney(ctx context.Context, amount float64) (bool, error) {
// return false, fmt.Errorf("Bank Service temporarily unavailable")
fmt.Printf("Successfully withdrawn $%.2f\n", amount)
return true, nil
}
func DepositMoney(ctx context.Context, amount float64) (bool, error) {
fmt.Printf("Successfully deposited $%.2f\n", amount)
return true, nil
}
8 / 9