-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed AppDirectory.GetApp to throw when the app is not found
Resolves #60
- Loading branch information
1 parent
ced0273
commit cba113e
Showing
5 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
{ | ||
} | ||
|
||
public AppNotFoundException() : base("The app was not found in the App Directory") { } | ||
protected AppNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Tests/MorganStanley.Fdc3.AppDirectory.Tests/MorganStanley.Fdc3.AppDirectory.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters