chore: 将 LCException 提到 LeanCloud 命名空间下,并增加 ToString()
parent
3e8e6b5f18
commit
86cf1eada2
|
@ -30,6 +30,9 @@
|
|||
<Compile Include="..\Common\Json\LCJsonConverter.cs">
|
||||
<Link>Json\LCJsonConverter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\Exception\LCException.cs">
|
||||
<Link>Exception\LCException.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
|
|
|
@ -13,5 +13,6 @@
|
|||
<Folder Include="Log\" />
|
||||
<Folder Include="Http\" />
|
||||
<Folder Include="Task\" />
|
||||
<Folder Include="Exception\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
using System;
|
||||
|
||||
namespace LeanCloud.Storage {
|
||||
namespace LeanCloud {
|
||||
/// <summary>
|
||||
/// LeanCloud 异常
|
||||
/// </summary>
|
||||
public class LCException : Exception {
|
||||
/// <summary>
|
||||
/// 错误码
|
||||
/// </summary>
|
||||
public int Code {
|
||||
get; set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
public new string Message {
|
||||
get; set;
|
||||
}
|
||||
|
@ -14,5 +23,9 @@ namespace LeanCloud.Storage {
|
|||
Code = code;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return $"{Code} - {Message}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,9 +15,6 @@
|
|||
<Compile Include="..\Storage\LCCloud.cs">
|
||||
<Link>LCCloud.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Storage\LCException.cs">
|
||||
<Link>LCException.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Storage\LCFile.cs">
|
||||
<Link>LCFile.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using NUnit.Framework;
|
||||
using LeanCloud.Storage;
|
||||
using LeanCloud;
|
||||
|
||||
namespace Storage.Test {
|
||||
public class ExceptionTest {
|
||||
|
|
Loading…
Reference in New Issue