[
  {
    "Id": "517752",
    "ThreadId": "233647",
    "Html": "\r\n<p>Why APIs such &quot;AddEntry&quot; do no try own Exceptions?</p>\r\n<p>If something goes wrong&nbsp;while I'm adding elements to a ZipFile, I would like to know what is the element that raise the Exception.</p>\r\n<p>Now, instead I have&nbsp;to implement a my procedure to check the specific element in the &quot;catch (...)&quot;</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-05T08:53:44.667-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "517800",
    "ThreadId": "233647",
    "Html": "\r\n<p>I'm having trouble with your English syntax.</p>\r\n<p>I don't understand what you mean by &quot;try own Exceptions&quot;.&nbsp;</p>\r\n<p>You're referring to a design decision in DotNetZip regarding exceptions, but I don't know exactly what the decision or behavior is.&nbsp; Also I don't understand what problem this behavior causes you.</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-05T10:14:07.933-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "517822",
    "ThreadId": "233647",
    "Html": "\r\n<p>&quot;try API (of the ZipNet classes) own exception. Sorry for the mistake.</p>\r\n<p>To clarify my idea I put here an example</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">try</span>\r\n{\r\n   Using (Zip....)\r\n   {\r\n\r\n      <span style=\"color:blue\">foreach</span> (<span style=\"color:blue\">var</span> o <span style=\"color:blue\">in</span> list)\r\n         Zip.AddEntry(o,......)\r\n   } \r\n}\r\n<span style=\"color:blue\">catch</span> (Exception or ArgumentException or Exception of System NS)\r\n{\r\n    <span style=\"color:green\">// do smt</span>\r\n}</pre>\r\n<pre><br></pre>\r\n<pre>If AddEntry raises an Exception I have to catch it as &quot;System Exception&quot; that doesn't tell me nothing about the object &quot;o&quot; I tried to put with AddEntry.&nbsp;</pre>\r\n<pre>So I have to do something like this:</pre>\r\n<pre><br></pre>\r\n<pre><div style=\"color:black; background-color:white\"><pre><span style=\"color:blue\">catch</span> (System.Exception....)\r\n{\r\n    <span style=\"color:blue\">foreach</span>( <span style=\"color:blue\">var</span> o <span style=\"color:blue\">in</span> list)\r\n        check what <span style=\"color:blue\">is</span> the &quot;o&quot; <span style=\"color:blue\">object</span> that has problem\r\n\r\n    MessageBox.Show(<span style=\"color:#a31515\">&quot;The object is&quot;</span>&#43; o)\r\n}\r\n</pre>\r\n</div>\r\n<br></pre>\r\n<pre>Instead, I would like something close to this:</pre>\r\n<pre><br></pre>\r\n<pre><div style=\"color:black; background-color:white\"><pre><span style=\"color:blue\">catch</span> (ZipNetException.DuplicatedItem ex)\r\n{\r\n    MessageBox.Show(<span style=\"color:#a31515\">&quot;The object probably is &quot;</span>&#43; e.Message)\r\n}\r\n</pre>\r\n</div>\r\n<br></pre>\r\n<pre>As you can see, in this code I catch YOUR exception and not a generic system exception.&nbsp;</pre>\r\n<pre>With your (ZipNet) exception I could have the entry that raised the exception.</pre>\r\n<pre><br></pre>\r\n<pre>Yes I think is a design question.</pre>\r\n<pre><br></pre>\r\n<pre>I hope my idea is more clear now</pre>\r\n<pre><br></pre>\r\n<pre>regards</pre>\r\n</div>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-05T10:49:46.643-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "517920",
    "ThreadId": "233647",
    "Html": "\r\n<p>ok, it is becoming a little clearer.</p>\r\n<p>I think what you are saying is that you would like to receive a exception that is specific to DotNetZip in case of a particular error or exception condition.</p>\r\n<p>Can you tell me, what is the specific exceptional condition you are referring to?&nbsp; what specific exception is raised currently by DotNetZip?&nbsp; Can you show a stacktrace, please?&nbsp;&nbsp; What specific exception would you like to receive?</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-05T13:33:58.523-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "517934",
    "ThreadId": "233647",
    "Html": "\r\n<p>I make a Zip with contents and relative entry names. It could happen that some entries are duplicated.&nbsp;</p>\r\n<p>In this case I would like to&nbsp;receive&nbsp;an &nbsp;Exception telling me the entry is already present. As the message of the Exception it could</p>\r\n<p>have the name of the Entry I try to add.&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>Monday morning I'm going to send you the stacktrace and the specific exception I get.</p>\r\n<p>&nbsp;</p>\r\n<p>thanks a lot</p>\r\n",
    "PostedDate": "2010-11-05T14:05:10.327-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "518368",
    "ThreadId": "233647",
    "Html": "\r\n<p>Thank you - send the stacktrace and we'll see if we can make some progress on that.</p>\r\n",
    "PostedDate": "2010-11-07T06:32:08.01-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "518672",
    "ThreadId": "233647",
    "Html": "\r\n<p>here is the StackTrace</p>\r\n<p></p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre>   <span style=\"color:blue\">in</span> System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)\r\n   <span style=\"color:blue\">in</span> System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n   <span style=\"color:blue\">in</span> System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\r\n   <span style=\"color:blue\">in</span> Ionic.Zip.ZipFile.InternalAddEntry(String name, ZipEntry entry)\r\n   <span style=\"color:blue\">in</span> Ionic.Zip.ZipFile._InternalAddEntry(ZipEntry ze)\r\n   <span style=\"color:blue\">in</span> Ionic.Zip.ZipFile.AddEntry(String entryName, Stream stream)\r\n   <span style=\"color:blue\">in</span> Ionic.Zip.ZipFile.AddEntry(String entryName, String content, Encoding encoding)\r\n   <span style=\"color:blue\">in</span> Ra....Sta.Logic.ProjectManager.SalvaProgetto(String nomeProgetto, List`1 listAg) <span style=\"color:blue\">in</span> C:\\Lavoro\\Lavoro\\...\\Logic\\ProjectManager.cs:riga 232\r\n</pre>\r\n</div>\r\n<p></p>\r\n<p>&nbsp;</p>\r\n<p>I catch the &quot;System.ArgumentException&quot;.</p>\r\n<p>thanks</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-08T03:22:41.957-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "519427",
    "ThreadId": "233647",
    "Html": "\r\n<p>Ah, yes, the generic Dictionary throws System.ArgumentException when you try to add a duplicate key.&nbsp;\r\n<a href=\"http://msdn.microsoft.com/en-us/library/k7z0zy8k.aspx\">http://msdn.microsoft.com/en-us/library/k7z0zy8k.aspx</a></p>\r\n<p>ok, now... what is the problem with that exception?&nbsp;&nbsp; Can you tell me what you would propose as an alternative? Would you prefer to get something like\r\n<code>Ionic.Zip.DuplicateZipEntryException</code> ?</p>\r\n<p>Let me think about that.&nbsp;</p>\r\n",
    "PostedDate": "2010-11-09T09:13:04.337-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "519461",
    "ThreadId": "233647",
    "Html": "\r\n<p>YES!!!</p>\r\n<p>I would like to have&nbsp;<code>Ionic.Zip.DuplicateZipEntryException</code>&nbsp;and in the payload of the exception the name of the entry I tried to add.</p>\r\n<p></p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">catch</span> (Ionic.Zip.DuplicateZipEntryException ex)\r\n{\r\n    MessageBox.Show(<span style=\"color:#a31515\">&quot;The object probably is &quot;</span>&#43; e.Message)\r\n}</pre>\r\n</div>\r\n<p></p>\r\n",
    "PostedDate": "2010-11-09T10:15:07.993-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "519474",
    "ThreadId": "233647",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/12458\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2010-11-09T10:37:13.76-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "519477",
    "ThreadId": "233647",
    "Html": "\r\n<p>ok Signor, I think that makes sense.</p>\r\n<p>This feature won't be available until I build a new release.&nbsp; I hope that will be soon, but no guarantees.</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-11-09T10:38:17.45-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]