Skip to content

Commit

Permalink
Adjust ImapFolder.Create(Async) to document proper ArgumentException …
Browse files Browse the repository at this point in the history
…case (#1789)

ArgumentException is apparently not only thrown when the `name` is empty, but also when the server rejects it, because it e.g. has a directory separator char in it.

See https://stackoverflow.com/questions/78844815/how-to-create-or-get-folders-in-mailkit-with-multiple-sub-folders-when-they-ar/78844857#78844857 for details.
  • Loading branch information
rklec authored Aug 7, 2024
1 parent 4494883 commit 07f8e19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MailKit/Net/Imap/ImapFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ async Task<IMailFolder> CreateAsync (ImapCommand ic, string encodedName, bool sp
/// <paramref name="name"/> is <c>null</c>.
/// </exception>
/// <exception cref="System.ArgumentException">
/// <paramref name="name"/> is empty.
/// <paramref name="name"/> is empty or invalid.
/// </exception>
/// <exception cref="System.ObjectDisposedException">
/// The <see cref="ImapClient"/> has been disposed.
Expand Down Expand Up @@ -954,7 +954,7 @@ public override IMailFolder Create (string name, bool isMessageFolder, Cancellat
/// <paramref name="name"/> is <c>null</c>.
/// </exception>
/// <exception cref="System.ArgumentException">
/// <paramref name="name"/> is empty.
/// <paramref name="name"/> is empty or invalid.
/// </exception>
/// <exception cref="System.ObjectDisposedException">
/// The <see cref="ImapClient"/> has been disposed.
Expand Down Expand Up @@ -1061,7 +1061,7 @@ ImapCommand QueueCreateCommand (string name, IEnumerable<SpecialFolder> specialU
/// <para><paramref name="specialUses"/> is <c>null</c>.</para>
/// </exception>
/// <exception cref="System.ArgumentException">
/// <paramref name="name"/> is empty.
/// <paramref name="name"/> is empty or invalid.
/// </exception>
/// <exception cref="System.ObjectDisposedException">
/// The <see cref="ImapClient"/> has been disposed.
Expand Down Expand Up @@ -1113,7 +1113,7 @@ public override IMailFolder Create (string name, IEnumerable<SpecialFolder> spec
/// <para><paramref name="specialUses"/> is <c>null</c>.</para>
/// </exception>
/// <exception cref="System.ArgumentException">
/// <paramref name="name"/> is empty.
/// <paramref name="name"/> is empty or invalid.
/// </exception>
/// <exception cref="System.ObjectDisposedException">
/// The <see cref="ImapClient"/> has been disposed.
Expand Down

0 comments on commit 07f8e19

Please sign in to comment.