Esempio n. 1
0
 private object GetFromCache(string key)
 {
     try
     {
         return(CacheFactory.GetInstance(GetCacheName()).Get(key));
     }
     catch (Exception ex)
     {
         if (m_ExceptionHandler != null)
         {
             m_ExceptionHandler.Handle(ex, new object[] { key });
         }
         return(null);
     }
 }
Esempio n. 2
0
 /// <inheritdoc />
 public async Task HandleException(
     Exception exception,
     IPipelineContext <TRequest, TResponse> pipelineContext,
     CancellationToken cancellationToken)
 {
     await _exceptionHandle.Handle(exception, pipelineContext, cancellationToken);
 }
 public bool HandleError(Exception error)
 {
     if (m_ExceptionHandler != null)
     {
         if (error != null && CheckIsBizException(error.GetType())) // BizExcpetion不需要记录日志
         {
             return(true);
         }
         object requestParams;
         OperationContext.Current.OutgoingMessageProperties.TryGetValue("_RequestParams_", out requestParams);
         m_ExceptionHandler.Handle(error, requestParams as object[]);
     }
     return(true);
 }