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