From 86cf1eada2bf7db677f44be37eb1ab68ecc0db41 Mon Sep 17 00:00:00 2001 From: oneRain Date: Thu, 21 May 2020 10:41:58 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=B0=86=20LCException=20=E6=8F=90?= =?UTF-8?q?=E5=88=B0=20LeanCloud=20=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E5=B9=B6=E5=A2=9E=E5=8A=A0=20ToString()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common/Common-Unity/Common-Unity.csproj | 3 +++ Common/Common/Common.csproj | 1 + .../Common/Exception}/LCException.cs | 15 ++++++++++++++- Storage/Storage-Unity/Storage-Unity.csproj | 3 --- Storage/Storage.Test/ExceptionTest.cs | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) rename {Storage/Storage => Common/Common/Exception}/LCException.cs (50%) diff --git a/Common/Common-Unity/Common-Unity.csproj b/Common/Common-Unity/Common-Unity.csproj index 4bb9263..9ab3475 100644 --- a/Common/Common-Unity/Common-Unity.csproj +++ b/Common/Common-Unity/Common-Unity.csproj @@ -30,6 +30,9 @@ Json\LCJsonConverter.cs + + Exception\LCException.cs + diff --git a/Common/Common/Common.csproj b/Common/Common/Common.csproj index 8157b01..669c947 100644 --- a/Common/Common/Common.csproj +++ b/Common/Common/Common.csproj @@ -13,5 +13,6 @@ + diff --git a/Storage/Storage/LCException.cs b/Common/Common/Exception/LCException.cs similarity index 50% rename from Storage/Storage/LCException.cs rename to Common/Common/Exception/LCException.cs index acf2249..1daebab 100644 --- a/Storage/Storage/LCException.cs +++ b/Common/Common/Exception/LCException.cs @@ -1,11 +1,20 @@ using System; -namespace LeanCloud.Storage { +namespace LeanCloud { + /// + /// LeanCloud 异常 + /// public class LCException : Exception { + /// + /// 错误码 + /// public int Code { get; set; } + /// + /// 错误信息 + /// public new string Message { get; set; } @@ -14,5 +23,9 @@ namespace LeanCloud.Storage { Code = code; Message = message; } + + public override string ToString() { + return $"{Code} - {Message}"; + } } } diff --git a/Storage/Storage-Unity/Storage-Unity.csproj b/Storage/Storage-Unity/Storage-Unity.csproj index 7ea411a..42d8e68 100644 --- a/Storage/Storage-Unity/Storage-Unity.csproj +++ b/Storage/Storage-Unity/Storage-Unity.csproj @@ -15,9 +15,6 @@ LCCloud.cs - - LCException.cs - LCFile.cs diff --git a/Storage/Storage.Test/ExceptionTest.cs b/Storage/Storage.Test/ExceptionTest.cs index 83f70b3..bcd80c0 100644 --- a/Storage/Storage.Test/ExceptionTest.cs +++ b/Storage/Storage.Test/ExceptionTest.cs @@ -1,5 +1,5 @@ using NUnit.Framework; -using LeanCloud.Storage; +using LeanCloud; namespace Storage.Test { public class ExceptionTest {