From af76d7a590694ef1361ed47caff1624c5cef1f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=8D=A3=E5=9B=BD?= Date: Fri, 11 Feb 2022 14:30:41 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=B0=86BaseException=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=94=BE=E5=88=B0ErrorMessage=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Parts/PartAppService.cs | 3 ++- .../PurchaseOrders/PurchaseOrderAppService.cs | 3 ++- .../Receipts/ReceiptAppService.cs | 3 ++- .../Suppliers/SuppliersAppService.cs | 3 ++- .../UnplannedReceipts/UnplannedReceiptAppService.cs | 3 ++- .../Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs | 5 +++++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs index f3e53c3..b5bb00b 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs @@ -77,8 +77,9 @@ namespace Win_in.Sfs.Scp.WebApi } catch (Exception ex) { + var baseEx = ex.GetBaseException(); entity.ErrorCode = 1; - entity.ErrorMessage = ex.Message; + entity.ErrorMessage = baseEx.Message; } var ret = await _partRepository.InsertAsync(entity); diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs index dba6271..e4b545e 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/PurchaseOrders/PurchaseOrderAppService.cs @@ -81,8 +81,9 @@ namespace Win_in.Sfs.Scp.WebApi } catch (Exception ex) { + var baseEx = ex.GetBaseException(); entity.ErrorCode = 1; - entity.ErrorMessage = ex.Message; + entity.ErrorMessage = baseEx.Message; } var ret = await _purchaseOrderRepository.InsertAsync(entity); var dto = ObjectMapper.Map(ret); diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs index 9d15950..1dc429c 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs @@ -80,8 +80,9 @@ namespace Win_in.Sfs.Scp.WebApi } catch (Exception ex) { + var baseEx = ex.GetBaseException(); entity.ErrorCode = 1; - entity.ErrorMessage = ex.Message; + entity.ErrorMessage = baseEx.Message; } var ret = await _receiptRepository.InsertAsync(entity); diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs index 9b26f4d..2172970 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs @@ -76,8 +76,9 @@ namespace Win_in.Sfs.Scp.WebApi } catch (Exception ex) { + var baseEx = ex.GetBaseException(); entity.ErrorCode = 1; - entity.ErrorMessage = ex.Message; + entity.ErrorMessage = baseEx.Message; } var ret = await _supplierRepository.InsertAsync(entity); diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs index 4c56743..db6425e 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs @@ -79,8 +79,9 @@ namespace Win_in.Sfs.Scp.WebApi } catch (Exception ex) { + var baseEx = ex.GetBaseException(); entity.ErrorCode = 1; - entity.ErrorMessage = ex.Message; + entity.ErrorMessage = baseEx.Message; } diff --git a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs index 8df4237..ba0d68a 100644 --- a/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs +++ b/WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs @@ -15,4 +15,9 @@ namespace Win_in.Sfs.Scp.WebApi LocalizationResource = typeof(WebApiResource); } } + + public static class ExceptionExtension + { + + } }