public void PaserServerError(Stream inputStream, string contentType, long contentLength) { CosServerException cosServerException = new CosServerException(cosResult.httpCode, cosResult.httpMessage); List <string> values; Headers.TryGetValue("x-cos-request-id", out values); cosServerException.requestId = (values != null && values.Count > 0) ? values[0] : null; Headers.TryGetValue("x-cos-trace-id", out values); cosServerException.traceId = (values != null && values.Count > 0) ? values[0] : null; if (inputStream != null && contentLength > 0) { CosServerError cosServerError = new CosServerError(); try { XmlParse.ParseCosError(inputStream, cosServerError); if (cosServerException.requestId != null) { cosServerException.requestId = cosServerError.requestId; } if (cosServerException.traceId != null) { cosServerException.traceId = cosServerError.traceId; } cosServerException.resource = cosServerError.resource; cosServerException.errorCode = cosServerError.code; cosServerException.errorMessage = cosServerError.message; } catch (Exception ex) { QLog.D(TAG, ex.Message); } } throw cosServerException; }
public void PaserServerError(Stream inputStream, string contentType, long contentLength) { CosServerException cosServerException = new CosServerException(cosResult.httpCode, cosResult.httpMessage); List <string> values; Headers.TryGetValue("x-cos-request-id", out values); cosServerException.requestId = (values != null && values.Count > 0) ? values[0] : null; Headers.TryGetValue("x-cos-trace-id", out values); cosServerException.traceId = (values != null && values.Count > 0) ? values[0] : null; if (inputStream != null) { try { CosServerError cosServerError = XmlParse.Deserialize <CosServerError>(inputStream); cosServerException.SetCosServerError(cosServerError); } catch (Exception ex) { QLog.Debug(TAG, ex.Message); } } throw cosServerException; }
public void OnFailed(CosClientException clientEx, CosServerException serverEx) { lock (syncExit) { isExit = true; } if (failCallback != null) { failCallback(clientEx, serverEx); } }
void OnCosUploadFail(CosClientException clientEx, CosServerException serverEx) { pollingPatchStatus.isActive = false; FinalizeProgress("Upload Failed"); Debug.Log("Upload Failed."); if (clientEx != null) { Debug.LogError("CosClientExceptionMessage: " + clientEx.Message); Debug.LogError("CosClientException: " + clientEx.StackTrace); } if (serverEx != null) { Debug.LogError("CosServerException: " + serverEx.GetInfo()); } Debug.LogError(String.Format("currentThread id = {0}", Thread.CurrentThread.ManagedThreadId)); }