public void addToResponse(HttpResponseBuilder response)
 {
     if (!newClientState.isEmpty())
     {
         try
         {
             response.setMetadata(CLIENT_STATE, newClientState.getEncryptedState());
         }
         catch (BlobCrypterException e)
         {
             // Configuration error somewhere, this should never happen.
             throw e;
         }
     }
     if (!String.IsNullOrEmpty(aznUrl))
     {
         response.setMetadata(APPROVAL_URL, aznUrl);
     }
     if (error != null)
     {
         response.setMetadata(ERROR_CODE, error);
     }
     if (errorText != null || sendTraceToClient)
     {
         StringBuilder verboseError = new StringBuilder();
         if (errorText != null)
         {
             verboseError.Append(errorText);
         }
         if (sendTraceToClient)
         {
             verboseError.Append('\n');
             verboseError.Append(getRequestTrace());
         }
         response.setMetadata(ERROR_TEXT, verboseError.ToString());
     }
 }