Legacy Dev Forum Posts

 View Only

Sign Up

An unknown error has occurred while executing a script action

  • 1.  An unknown error has occurred while executing a script action

    Posted 06-05-2025 19:12

    Hampus_Nygren | 2022-04-26 07:15:49 UTC | #1

    Hi,

    I have a custom data action which loop and checks the status of Scripter.Interaction State started by "Page load action" It works perfect with one interaction active, but when a agent accepts a second interaction I get "An unknown error has occurred while executing a script action"

    I have problems to locate which step in my script that generates this error and since I use try/on error, the chrome console points to the "Page load action"

    Can you give me some guidance on how to pinpoint the error.


    Hampus_Nygren | 2022-05-05 06:03:35 UTC | #2

    Hi,

    An update to this, my action above contained a recursive behavior, this design pattern is mentioned on a number of pages in this community.

    For test I made: Page load action calls "My action". "My action" has a delay for 1000ms, then it calls "My action" again.

    When a call is declined, the script fails with "An unknown error has occurred while executing a script action", is this something that everyone who uses recursive actions experience? Is the design pattern ok? Bug?


    samjan | 2022-05-23 12:48:38 UTC | #3

    I have the exact same issue and question. You probably get the same error as me. "scripter: Error: Attempted to read a disposed property" This makes perfect sense if the action is run after the agent declines. It would be good to know if running recursive action with a delay is a valid pattern according to Genesys. And if it's somehow possible to not get this error.


    samjan | 2022-05-24 10:53:41 UTC | #4

    I found a solution.

    Since the same script is used for outbound calls on behalf of the queue, I don't want to try to unpause outbound calls, as that would trigger a script error. (outbound calls would have state == Connecting, inbound have state == Incoming)

    Adding "If {{Scripter.Interaction State}} Equals Incoming" to the else clause also fixed the problem of having the recursive function running "out of bounds". Now I dont see any script errors when not responding or declining calls.


    Hampus_Nygren | 2022-05-25 12:51:13 UTC | #5

    Hi,

    Thank you for the update! Very interesting, I will look into if I can solve my problems using your input.


    system | 2022-06-25 12:51:25 UTC | #6

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 14454