-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved error handling for webservice requests.
- Loading branch information
Showing
7 changed files
with
139 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="LookupResponse.cs" company=""> | ||
// Christian Woltering, https://github.com/wo80 | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace AcoustID.Web | ||
{ | ||
using System.Collections.Generic; | ||
using System.Net; | ||
|
||
/// <summary> | ||
/// The webservice response containing the status code and a list of lookup results. | ||
/// </summary> | ||
public class LookupResponse | ||
{ | ||
public LookupResponse() | ||
: this(HttpStatusCode.OK, null) | ||
{ | ||
} | ||
|
||
public LookupResponse(HttpStatusCode status, string error) | ||
{ | ||
this.StatusCode = status; | ||
this.ErrorMessage = error; | ||
|
||
Results = new List<LookupResult>(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the status code returned by the webservice. | ||
/// </summary> | ||
public HttpStatusCode StatusCode { get; internal set; } | ||
|
||
/// <summary> | ||
/// Gets the error message, in case the status code is not "200 OK". | ||
/// </summary> | ||
public string ErrorMessage { get; internal set; } | ||
|
||
/// <summary> | ||
/// Gets a list of <see cref="LookupResult"/>s. | ||
/// </summary> | ||
public List<LookupResult> Results { get; private set; } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="SubmitResponse.cs" company=""> | ||
// Christian Woltering, https://github.com/wo80 | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace AcoustID.Web | ||
{ | ||
public class SubmitResponse | ||
{ | ||
} | ||
} |
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