Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions BatchDotnetTutorialFfmpeg/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,10 @@ private static async Task CreatePoolIfNotExistAsync(BatchClient batchClient, str

await pool.CommitAsync();
}
catch (BatchException be)
// Accept the specific error code PoolExists as that is expected if the pool already exists
catch (BatchException be) when (be.RequestInformation?.BatchError?.Code == BatchErrorCodeStrings.PoolExists)
{
// Accept the specific error code PoolExists as that is expected if the pool already exists
if (be.RequestInformation?.BatchError?.Code == BatchErrorCodeStrings.PoolExists)
{
Console.WriteLine("The pool {0} already existed when we tried to create it", poolId);
}
else
{
throw; // Any other exception is unexpected
}
Console.WriteLine("The pool {0} already existed when we tried to create it", poolId);
}
}

Expand Down