GithubHelp home page GithubHelp logo

Comments (5)

mitul69 avatar mitul69 commented on September 27, 2024

I have same use,
I have try with await but and added try catch but never comes with catch as well.

When there is some issue in api call it always break the application is there any solution??

from monday-sdk-js.

KODIKAS-NL avatar KODIKAS-NL commented on September 27, 2024

I have same use,
I have try with await but and added try catch but never comes with catch as well.

When there is some issue in api call it always break the application is there any solution??

I work around it using a 30 second timeout, here is my Typescipt code:

private async callApi<T>(query: string, options?: { token?: string, variables?: { [key: string]: any } }): Promise<T> {
        return new Promise(async (resolve, reject) => {
            var running = true;
            setTimeout(() => {
                if (!running)
                    return
                reject("Timeout, an error probably occured")
                running = false
            }, 30000)

            try {
                var result = await this.mondayApi.callApi<T>(query, options)
                if (!running)
                    return
                resolve(result)
            } catch (e) {
                reject(e)
            }
            running = false
        })
    }

from monday-sdk-js.

mitul69 avatar mitul69 commented on September 27, 2024

@KODIKAS-NL Thank you for.

But this is not good way to wait for 30 seconds. For me I am calling couple of queries I have change your login 10 seconds
thank you

from monday-sdk-js.

KODIKAS-NL avatar KODIKAS-NL commented on September 27, 2024

@KODIKAS-NL Thank you for.

But this is not good way to wait for 30 seconds. For me I am calling couple of queries I have change your login 10 seconds
thank you

Looks like a real fix is in the works: #39

from monday-sdk-js.

vladmonday avatar vladmonday commented on September 27, 2024

Solved in 0.1.1 version

from monday-sdk-js.

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.