Beispiel #1
0
        protected virtual RemoteServiceErrorInfo GetErrorInfo(UserExceptionInformerContext context)
        {
            if (context.Exception is AbpRemoteCallException remoteCallException)
            {
                return(remoteCallException.Error);
            }

            return(ExceptionToErrorInfoConverter.Convert(context.Exception, false));
        }
        public void Inform(UserExceptionInformerContext context)
        {
            var errorInfo = GetErrorInfo(context);

            if (errorInfo.Details.IsNullOrEmpty())
            {
                //TODO: Should we introduce MessageService.Error (sync) method instead of such a usage (without await)..?
                MessageService.ErrorAsync(errorInfo.Message);
            }
            else
            {
                MessageService.ErrorAsync(errorInfo.Details, errorInfo.Message);
            }
        }
Beispiel #3
0
        public virtual async Task InformAsync(UserExceptionInformerContext context)
        {
            var errorInfo = GetErrorInfo(context);

            await ShowErrorInfoAsync(errorInfo);
        }