Rollback of previous change, only needed to throw the right exception.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1936 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-06-26 13:51:22 +00:00
parent c6d2350d94
commit 715d06842e

View file

@ -294,14 +294,14 @@ namespace Jira {
try {
string base64String = Convert.ToBase64String(buffer, Base64FormattingOptions.InsertLineBreaks);
jira.addBase64EncodedAttachmentsToIssue(credentials, issueKey, new string[] { filename }, new string[] { base64String });
} catch (Exception ex1) {
} catch (ArgumentException ex1) {
LOG.WarnFormat("Failed to upload by using method addBase64EncodedAttachmentsToIssue, error was {0}", ex1.Message);
try {
LOG.Warn("Trying addAttachmentsToIssue instead");
jira.addAttachmentsToIssue(credentials, issueKey, new string[] { filename }, (sbyte[]) (Array)buffer);
} catch (Exception ex2) {
LOG.WarnFormat("Failed to use alternative method, error was: {0}", ex2.Message);
throw ex1;
throw ex2;
}
}
}