forked from anthonyreilly/NetCoreForce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForceAPIException.cs
44 lines (37 loc) · 1.43 KB
/
ForceAPIException.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Net;
using NetCoreForce.Client.Models;
namespace NetCoreForce.Client
{
public class ForceApiException : Exception
{
public List<ErrorResponse> Errors { get; set; }
// public string[] Fields { get; private set; }
// public string ErrorCode { get; private set; }
public HttpStatusCode HttpStatusCode { get; private set; }
/// <summary>
/// Returned when an external ID exists in more than one record
/// Lists matching objects in object url format, e.g. "/services/data/v57.0/sobjects/Account/001XXXXXXXXXXXXXXX"
/// </summary>
public List<string> ObjectUrls { get; set; }
public ForceApiException(string message)
: this(message, new List<ErrorResponse>(), new HttpStatusCode())
{
}
public ForceApiException(string message, List<ErrorResponse> errors)
: this(message, errors, new HttpStatusCode())
{
}
public ForceApiException(string message, ErrorResponse error, HttpStatusCode httpStatusCode)
: this(message, new List<ErrorResponse>() { error }, new HttpStatusCode())
{
}
public ForceApiException(string message, List<ErrorResponse> errors, HttpStatusCode httpStatusCode)
: base(message)
{
Errors = errors;
HttpStatusCode = httpStatusCode;
}
}
}