Welcome to the Linux Foundation Forum!

Labs (ch-7 / labs-1) serverError validate

Server error validation when the branded service is inactive:
The req.setTimeout (1500) on line 27 (validate.js) delays a short time for the response with statusCode 500.
And validation fails because the server does not respond in time.



  • aalthawr
    aalthawr Posts: 1
    edited May 31

    You can do something like this

    SPOILERS! ->
    const boat = await got(`${boatSrv}/${id}`, {timeout: 600, retry:0}).json()
    const brand = await got(`${brandSrv}/${boat.brand}`, {timeout: 600, retry:0}).json()

  • cool, great solution.
    thank you so much @aalthawr !!

  • @aalthawr thanks for this! I've wrapped your comment in a

    element to avoid spoilers
  • Perfect! I had been looking through the got docs and didn't see anything as simple as what you posted @aalthawr.


Upcoming Training