-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🛠errors in calls to Jira server now rethrown enriched with call argu…
…ments
- Loading branch information
Showing
9 changed files
with
225 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace jwl.jira.Exceptions; | ||
|
||
internal class AddWorkLogException | ||
: JiraIssueSpecificException | ||
{ | ||
public DateTime Moment { get; } | ||
public int TimeSpentSeconds { get; } | ||
public string? Activity { get; init; } | ||
public string? Comment { get; init; } | ||
|
||
public AddWorkLogException(string issueKey, DateTime moment, int timeSpentSeconds) | ||
: base(issueKey, $"Error adding {timeSpentSeconds} seconds on issue {issueKey} at {moment}") | ||
{ | ||
Moment = moment; | ||
TimeSpentSeconds = timeSpentSeconds; | ||
} | ||
|
||
public AddWorkLogException(string issueKey, DateTime moment, int timeSpentSeconds, Exception innerException) | ||
: base(issueKey, $"Error adding {timeSpentSeconds} seconds on issue {issueKey} at {moment}", innerException) | ||
{ | ||
Moment = moment; | ||
TimeSpentSeconds = timeSpentSeconds; | ||
} | ||
} |
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 @@ | ||
namespace jwl.jira.Exceptions; | ||
|
||
[Serializable] | ||
internal class DeleteWorklogException | ||
: JiraIssueSpecificException | ||
{ | ||
public long IssueId { get; } | ||
public long WorklogId { get; } | ||
|
||
public DeleteWorklogException(long issueId, long worklogId) | ||
: base($"ID {issueId}", $"Error deleting worklog ID {worklogId} on issue ID {issueId}") | ||
{ | ||
IssueId = issueId; | ||
WorklogId = worklogId; | ||
} | ||
|
||
public DeleteWorklogException(long issueId, long worklogId, Exception innerException) | ||
: base($"ID {issueId}", $"Error deleting worklog ID {worklogId} on issue ID {issueId}", innerException) | ||
{ | ||
IssueId = issueId; | ||
WorklogId = worklogId; | ||
} | ||
} |
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,24 @@ | ||
namespace jwl.jira.Exceptions; | ||
|
||
using System; | ||
|
||
public class GetIssueWorkLogsException | ||
: JiraIssueSpecificException | ||
{ | ||
public DateTime DateFrom { get; } | ||
public DateTime DateTo { get; } | ||
|
||
public GetIssueWorkLogsException(string issueKey, DateTime dateFrom, DateTime dateTo) | ||
: base(issueKey, $"Error retrieving worklogs for {issueKey} and timestamp range from {dateFrom} to {dateTo}") | ||
{ | ||
DateFrom = dateFrom; | ||
DateTo = dateTo; | ||
} | ||
|
||
public GetIssueWorkLogsException(string issueKey, DateTime dateFrom, DateTime dateTo, Exception innerException) | ||
: base(issueKey, $"Error retrieving worklogs for issue \"{issueKey}\" and period from {dateFrom} to {dateTo}", innerException) | ||
{ | ||
DateFrom = dateFrom; | ||
DateTo = dateTo; | ||
} | ||
} |
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,21 @@ | ||
namespace jwl.jira.Exceptions; | ||
|
||
using System; | ||
|
||
public class JiraClientException | ||
: ApplicationException | ||
{ | ||
public JiraClientException() | ||
{ | ||
} | ||
|
||
public JiraClientException(string? message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public JiraClientException(string? message, Exception? innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
} |
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,31 @@ | ||
namespace jwl.jira.Exceptions; | ||
|
||
public class JiraIssueSpecificException | ||
: JiraClientException | ||
{ | ||
public string? IssueKey { get; } | ||
|
||
public JiraIssueSpecificException(string issueKey) | ||
: base($"Error on Jira issue {issueKey}") | ||
{ | ||
IssueKey = issueKey; | ||
} | ||
|
||
public JiraIssueSpecificException(string issueKey, string message) | ||
: base(message) | ||
{ | ||
IssueKey = issueKey; | ||
} | ||
|
||
public JiraIssueSpecificException(string issueKey, Exception innerException) | ||
: base($"Error on Jira issue {issueKey}", innerException) | ||
{ | ||
IssueKey = issueKey; | ||
} | ||
|
||
public JiraIssueSpecificException(string issueKey, string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
IssueKey = issueKey; | ||
} | ||
} |
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,27 @@ | ||
namespace jwl.jira.Exceptions; | ||
|
||
public class UpdateWorklogException | ||
: JiraIssueSpecificException | ||
{ | ||
public long WorklogId { get; } | ||
public DateTime Moment { get; } | ||
public int TimeSpentSeconds { get; } | ||
public string? Activity { get; init; } | ||
public string? Comment { get; init; } | ||
|
||
public UpdateWorklogException(string issueKey, long worklogId, DateTime moment, int timeSpentSeconds) | ||
: base(issueKey, $"Error updating worklog ID {worklogId} with {timeSpentSeconds} seconds on issue {issueKey} at {moment}") | ||
{ | ||
WorklogId = worklogId; | ||
Moment = moment; | ||
TimeSpentSeconds = timeSpentSeconds; | ||
} | ||
|
||
public UpdateWorklogException(string issueKey, long worklogId, DateTime moment, int timeSpentSeconds, Exception innerException) | ||
: base(issueKey, $"Error updating worklog ID {worklogId} with {timeSpentSeconds} seconds on issue {issueKey} at {moment}", innerException) | ||
{ | ||
WorklogId = worklogId; | ||
Moment = moment; | ||
TimeSpentSeconds = timeSpentSeconds; | ||
} | ||
} |
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