Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppNotFoundException #61

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/Fdc3.AppDirectory/AppDirectoryException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Morgan Stanley makes this available to you under the Apache License,
* Version 2.0 (the "License"). You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.
*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Unless required by applicable law or agreed
* to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/

using System;
using System.Runtime.Serialization;

namespace MorganStanley.Fdc3.AppDirectory
{
/// <summary>
/// Base class for exceptions thrown by <see cref="IAppDirectory"/> implementations
/// </summary>
public class AppDirectoryException : Exception
{
public AppDirectoryException() { }
protected AppDirectoryException(SerializationInfo info, StreamingContext context) : base(info, context) { }
public AppDirectoryException(string message) : base(message) { }
public AppDirectoryException(string message, Exception innerException) : base(message, innerException) { }

Check warning on line 28 in src/Fdc3.AppDirectory/AppDirectoryException.cs

View check run for this annotation

Codecov / codecov/patch

src/Fdc3.AppDirectory/AppDirectoryException.cs#L25-L28

Added lines #L25 - L28 were not covered by tests
}
}
31 changes: 31 additions & 0 deletions src/Fdc3.AppDirectory/AppNotFoundException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Morgan Stanley makes this available to you under the Apache License,
* Version 2.0 (the "License"). You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.
*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Unless required by applicable law or agreed
* to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/

using System.Runtime.Serialization;

namespace MorganStanley.Fdc3.AppDirectory
{
/// <summary>
/// The exception that is thrown by <see cref="IAppDirectory.GetApp"/> when the app is not found.
/// </summary>
public class AppNotFoundException : AppDirectoryException
{
public AppNotFoundException(string appId) : base($"The app with id '{appId}' was not found in the App Directory")

Check warning on line 24 in src/Fdc3.AppDirectory/AppNotFoundException.cs

View check run for this annotation

Codecov / codecov/patch

src/Fdc3.AppDirectory/AppNotFoundException.cs#L24

Added line #L24 was not covered by tests
{
}

Check warning on line 26 in src/Fdc3.AppDirectory/AppNotFoundException.cs

View check run for this annotation

Codecov / codecov/patch

src/Fdc3.AppDirectory/AppNotFoundException.cs#L26

Added line #L26 was not covered by tests

public AppNotFoundException() : base("The app was not found in the App Directory") { }
protected AppNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }

Check warning on line 29 in src/Fdc3.AppDirectory/AppNotFoundException.cs

View check run for this annotation

Codecov / codecov/patch

src/Fdc3.AppDirectory/AppNotFoundException.cs#L28-L29

Added lines #L28 - L29 were not covered by tests
}
}
3 changes: 2 additions & 1 deletion src/Fdc3.AppDirectory/IAppDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface IAppDirectory
/// </summary>
/// <param name="appId">Application identifier</param>
/// <returns>The application</returns>
Task<Fdc3App?> GetApp(string appId);
/// <exception cref="AppNotFoundException">The app was not found</exception>
Task<Fdc3App> GetApp(string appId);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
* or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
global using Xunit;
global using Xunit;
Loading