Skip to content

Commit

Permalink
feat: add httpResponse to exceptions, modify request, shipengine inte…
Browse files Browse the repository at this point in the history
…rface
  • Loading branch information
jpill committed Jun 20, 2024
1 parent ca75fcd commit 9d3ad15
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 16 deletions.
8 changes: 6 additions & 2 deletions ShipEngine/Models/ShipEngineException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma warning disable 1591

using System;
using System.Net.Http;

namespace ShipEngineSDK
{
Expand Down Expand Up @@ -32,18 +33,21 @@ public class ShipEngineException : Exception
/// </summary>
public ErrorCode ErrorCode { get; set; }

public HttpResponseMessage? Response { get; set; }

public ShipEngineException(
string message,
ErrorSource errorSource = ErrorSource.Shipengine,
ErrorType errorType = ErrorType.System,
ErrorCode errorCode = ErrorCode.Unspecified,
string requestID = null) : base(message)
HttpResponseMessage? response = null,
string? requestId = null) : base(message)
{
ErrorSource = errorSource;
ErrorType = errorType;
ErrorCode = errorCode;
RequestId = requestID;
Response = response;
RequestId = requestId;
}
}
}
Loading

0 comments on commit 9d3ad15

Please sign in to comment.