Skip to content

Commit

Permalink
Ensure that error codes will not break SDK parsing in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-spence-avalara committed Dec 27, 2017
1 parent cbcd530 commit 8d70e01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/ErrorInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ namespace Avalara.AvaTax.RestClient
public class ErrorInfo
{
/// <summary>
/// Type of error that occurred
/// Type of error that occurred.
/// </summary>
public ErrorCodeId? code { get; set; }
/// <remarks>
/// This value is captured as a string so that if the server adds new error codes it will still parse.
///
/// You can compare this value to the ErrorCodeId enumeration.
/// </remarks>
public String code { get; set; }

/// <summary>
/// Short one-line message to summaryize what went wrong
Expand All @@ -22,7 +27,10 @@ public class ErrorInfo
/// <summary>
/// What object or service caused the error?
/// </summary>
public ErrorTargetCode? target { get; set; }
/// <remarks>
/// This value is captured as a string so that if the server adds new error targets it will still parse.
/// </remarks>
public String target { get; set; }

/// <summary>
/// Array of detailed error messages
Expand Down
5 changes: 4 additions & 1 deletion src/models/ErrorDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public class ErrorDetail
/// <summary>
/// Name of the error or message.
/// </summary>
public ErrorCodeId? code { get; set; }
/// <remarks>
/// This value is captured as a string so that if the server adds new error codes it will still parse.
/// </remarks>
public String code { get; set; }

/// <summary>
/// Unique ID number referring to this error or message.
Expand Down

0 comments on commit 8d70e01

Please sign in to comment.