Skip to content

Commit d8ae458

Browse files
authored
Add TimeoutException (#137)
1 parent a948609 commit d8ae458

File tree

5 files changed

+55
-1
lines changed

5 files changed

+55
-1
lines changed

Tests/NFUnitTestException/NFUnitTestException.nfproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
<ProjectReference Include="..\TestFramework\TestFramework.nfproj" />
3636
<ProjectReference Include="..\UnitTestLauncher\UnitTestLauncher.nfproj" />
3737
</ItemGroup>
38+
<ItemGroup>
39+
<None Include="nano.runsettings" />
40+
</ItemGroup>
3841
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
3942
<ProjectExtensions>
4043
<ProjectCapabilities>

Tests/NFUnitTestException/UnitTestExceptionTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ namespace NFUnitTestException
1313
[TestClass]
1414
public class UnitTestExceptionTests
1515
{
16+
[TestMethod]
17+
public void TestTimeoutException()
18+
{
19+
Assert.Throws(typeof(TimeoutException), () =>
20+
{
21+
throw new TimeoutException();
22+
});
23+
}
24+
1625
[TestMethod]
1726
public void Exc_excep01_Test()
1827
{

nanoFramework.CoreLibrary/CoreLibrary.nfproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
<Compile Include="System\Threading\SpinWait.cs" />
203203
<Compile Include="System\Threading\Timer.cs" />
204204
<Compile Include="System\Threading\WaitHandle.cs" />
205+
<Compile Include="System\TimeoutException.cs" />
205206
<Compile Include="System\TimeSpan.cs" />
206207
<Compile Include="System\Type.cs" />
207208
<Compile Include="System\TypeCode.cs" />

nanoFramework.CoreLibrary/System/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
[assembly: AssemblyProduct(".NET nanoFramework mscorlib")]
1414
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
1515

16-
[assembly: AssemblyNativeVersion("100.5.0.8")]
16+
[assembly: AssemblyNativeVersion("100.5.0.9")]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
4+
// See LICENSE file in the project root for full license information.
5+
//
6+
7+
namespace System
8+
{
9+
/// <summary>
10+
/// The exception that is thrown when the time allotted for a process or operation has expired.
11+
/// </summary>
12+
[Serializable]
13+
public class TimeoutException : SystemException
14+
{
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="TimeoutException"/> class.
17+
/// </summary>
18+
public TimeoutException()
19+
{
20+
}
21+
22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="TimeoutException"/> class with a specified error message.
24+
/// </summary>
25+
/// <param name="message">The message that describes the error.</param>
26+
public TimeoutException(String message)
27+
: base(message)
28+
{
29+
}
30+
31+
/// <summary>
32+
/// Initializes a new instance of the <see cref="TimeoutException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
33+
/// </summary>
34+
/// <param name="message">The error message that explains the reason for the exception.</param>
35+
/// <param name="innerException">The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.</param>
36+
public TimeoutException(String message, Exception innerException)
37+
: base(message, innerException)
38+
{
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)