-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #496 from EasyPost/bad_request_error
feat: maps 400 status codes to BadRequestError class
- Loading branch information
Showing
4 changed files
with
29 additions
and
0 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
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,23 @@ | ||
using System.Collections.Generic; | ||
using EasyPost.Models.API; | ||
|
||
namespace EasyPost.Exceptions.API | ||
{ | ||
/// <summary> | ||
/// Represents an error that occurs when an bad request is made to the EasyPost API. | ||
/// </summary> | ||
public class BadRequestError : ApiError | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="BadRequestError" /> class. | ||
/// </summary> | ||
/// <param name="errorMessage">The error message to print to console.</param> | ||
/// <param name="statusCode">Optional HTTP status code to store as a property.</param> | ||
/// <param name="errorType">Optional error type string to store as a property.</param> | ||
/// <param name="errors">Optional list of <see cref="Error"/> objects to store as a property.</param> | ||
internal BadRequestError(string errorMessage, int statusCode, string? errorType = null, List<Error>? errors = null) | ||
: base(errorMessage, statusCode, errorType, errors) | ||
{ | ||
} | ||
} | ||
} |