Is axios written without catch in the same way as using catch?

1. It is written

on the official website.
axios.post(url, data)
    .then(response => {
        console.log(response);
    })
    .catch(error => {
           console.log(error);
    })

2. The company project is written as

axios.post(url, data)
    .then(response => {
        console.log(response);
    }, error => {
        console.log(error);
    })

I am a rookie. I haven"t used then and catch before. Are these two writing methods the same? Thank you

Apr.05,2021

first of all, this is not about axios catch but about the then of new Promise ()
Ruan Yifeng wrote very clearly in the promise document

then Reject thencatch
// bad
promise
  .then(function(data) {
    // success
  }, function(err) {
    // error
  });

// good
promise
  .then(function(data) { //cb
    // success
  })
  .catch(function(err) {
    // error
  });
thentry/catchcatchthen

there is no saying that who is good or bad mainly depends on the business. It may be easy to understand some

in this way.

catch

 console.log(response);

the above code reports an error and cannot be captured.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3df5a-2c3c9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3df5a-2c3c9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?