internal Task CreateNoteAsync(MergeRequestKey mrk, CreateNewNoteParameters parameters)
 {
     return(callWithSharedClient(
                async(client) =>
                await OperatorCallWrapper.Call(
                    async() =>
                    await client.RunAsync(
                        async(gl) =>
                        await gl.Projects.Get(mrk.ProjectKey.ProjectName).MergeRequests.Get(mrk.IId).
                        Notes.CreateNewTaskAsync(parameters)))));
 }
 async public Task CreateNoteAsync(CreateNewNoteParameters parameters)
 {
     try
     {
         await _discussionOperator.CreateNoteAsync(_mergeRequestKey, parameters);
     }
     catch (OperatorException ex)
     {
         throw new DiscussionCreatorException(false, ex);
     }
 }
Beispiel #3
0
 async public Task CreateNoteAsync(CreateNewNoteParameters parameters)
 {
     try
     {
         await DiscussionOperator.CreateNoteAsync(MergeRequestDescriptor, parameters);
     }
     catch (OperatorException)
     {
         throw new DiscussionCreatorException(false);
     }
 }
Beispiel #4
0
        async public Task CreateNoteAsync(CreateNewNoteParameters parameters)
        {
            if (_discussionOperator == null)
            {
                return;
            }

            try
            {
                await _discussionOperator.CreateNoteAsync(_mergeRequestKey, parameters);

                _modificationListener.OnDiscussionModified(_mergeRequestKey);
            }
            catch (OperatorException ex)
            {
                throw new DiscussionCreatorException(false, ex);
            }
        }
Beispiel #5
0
        async internal Task CreateNoteAsync(MergeRequestDescriptor mrd, CreateNewNoteParameters parameters)
        {
            GitLabClient client = new GitLabClient(mrd.HostName, Tools.Tools.GetAccessToken(mrd.HostName, Settings));

            try
            {
                await client.RunAsync(async (gitlab) =>
                                      await gitlab.Projects.Get(mrd.ProjectName).MergeRequests.Get(mrd.IId).
                                      Notes.CreateNewTaskAsync(parameters));
            }
            catch (Exception ex)
            {
                Debug.Assert(!(ex is GitLabClientCancelled));
                if (ex is GitLabSharpException || ex is GitLabRequestException)
                {
                    ExceptionHandlers.Handle(ex, "Cannot create a note");
                    throw new OperatorException(ex);
                }
                throw;
            }
        }