Git Product home page Git Product logo

Comments (5)

sgellock avatar sgellock commented on July 28, 2024

V3 SDK issue

from botbuilder-v3.

mdrichardson avatar mdrichardson commented on July 28, 2024

@Eli2590 I'm unable to replicate this. Can you:

  1. Verify that you're using the latest V3 packages? 3.30.0
  2. Copy/paste your entire FormDialog.cs and any other relevant code?

Also note: It would be a good idea to start migrating to Botframework v4.

from botbuilder-v3.

Eli2590 avatar Eli2590 commented on July 28, 2024
  1. Yes, I am using the latest V3 packages.
  2. This is the FormDialog.cs:
using System;
using System.Threading.Tasks;
using KusBot.Common;
using KusBot.Forms;
using Kusto.Cloud.Platform.Utils;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;

namespace KusBot.Dialogs
{
    [Serializable]
    public class FormDialog : IDialog<string>
    {
        private readonly IDialog<RequestFormBase> m_requestForm;

        public FormDialog(IDialog<RequestFormBase> requestForm)
        {
            m_requestForm = requestForm;
        }

        public async Task StartAsync(IDialogContext context)
        {
            try
            {
                context.Call(m_requestForm, CompleteForm);
            }
            catch (Exception exception)
            {
                DiagnosticsTrace.TraceException($"Failure to complete request form.", exception, PrivateTracer.Tracer);
                await context.PostAsync(Prompts.FormExceptionMessage);
                context.Done(string.Empty);
            }
        }

        public async Task CompleteForm(IDialogContext context, IAwaitable<RequestFormBase> result)
        {
            try
            {
                var requestForm = await result;
                await requestForm.CompleteForm(context);
            }
            catch (Exception exception)
            {
                HandleFormException(context, exception);
                context.Done(string.Empty);
            }
        }

        public static async void HandleFormException(IDialogContext context, Exception exception)
        {
            if (exception is FormCanceledException)
            {
                string reply;
                if (exception.InnerException == null)
                {
                    // User cancelled the form
                    reply = "It was great talking to you! I hope I was helpful.";
                    PrivateTracer.Tracer.TraceInformation("User decided to quit the form");
                }
                else
                {
                    // Exception was thrown
                    reply = Prompts.FormExceptionMessage;
                    DiagnosticsTrace.TraceException($"Failure to complete form. Exception:", exception, PrivateTracer.Tracer);
                }
                await context.PostAsync(reply);
            }
            else
            {
                DiagnosticsTrace.TraceException($"Failure to open request ticket. Exception:", exception, PrivateTracer.Tracer);
                await context.PostAsync(Prompts.FormExceptionMessage);
            }
        }

        #region Tracer
        private class PrivateTracer : TraceSourceBase<PrivateTracer>
        {
            /// <summary>
            /// The string that identifies this trace source
            /// </summary>
            private const string c_identifierString = "KusBot.FormDialog";

            /// <summary>
            /// Implements <see cref="TraceSourceBase{T}.Id"/>
            /// </summary>
            public override String Id
            {
                get { return c_identifierString; }
            }

            /// <summary>
            /// Implements <see cref="TraceSourceBase{T}.DefaultVerbosity"/>
            /// </summary>
            public override TraceVerbosity DefaultVerbosity
            {
                get { return TraceVerbosity.Verbose; }
            }
        }
        #endregion
    }
}

from botbuilder-v3.

mdrichardson avatar mdrichardson commented on July 28, 2024

@Eli2590 Looking at the error closer, it looks like it may actually be in your ChangePermissionForm. Can you link me to all of your code and provide steps to reproduce? At the very, very least, I'd need to see ChangePermissionForm.

from botbuilder-v3.

mdrichardson avatar mdrichardson commented on July 28, 2024

Closing the issue as @Eli2590 will be focusing time on upgrading to v4 (discussed over Teams).

from botbuilder-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.