Robot Not a Dev? Pre-order Now
Not a Dev?

Documentation Improvements



In the tutorials,"http://" + ip + "/api/led/change", data) is followed by the same command.

There are three different commands that are slowly building up what to do, and I am not sure if it is necessary to have this part of the code as three commands building up the, then repeating it and adding the then, and then repeating both parts and adding the catch.

Using the final command and adding all of the comments may be a better option.


Thanks for sending this and welcome to the Misty community!


Thanks, Ben.

I am new to JavaScript, and I was not sure how to properly format this section of code.

    .then(function (response) { 
        console.log(`ChangeLED was a ${[0].status}`)
    // Use a catch() method after then(). catch() triggers if the promise is rejected. Pass a callback to catch() to print any errors returned by the request to the console.
    .catch(function (error) {
        console.log(`There was an error with the request ${error}`);

This is the error that I saw: MistyTutorial.html:23 Uncaught (in promise) TypeError: Cannot read property 'catch' of undefined

It seems like the backticks in the console.log created JavaScript errors. I still have other errors though.


Hey, I figured out the issue, the code should be"http://" + ip + "/api/led/change", data)
.then(function (response) {
    console.log('ChangeLED was a ${[0].status}');})
 .catch(function (error) {
            console.log('There was an error with the request ${error}');


Ah, thank so much for catching this! We’ll update the docs to fix the syntax (& to break up those comment lines so they’re easier to read! :slight_smile: )