Improving Error Handling in the STSClient