Ajax cross-domain cannot get http error code

as above.
when calling a cross-domain interface, if the interface returns an error code such as 500, the front end cannot obtain the response error code (of course, 200 code is able to obtain information normally).
it seems impossible to solve it at the front-end level. How should the server make changes so that the front-end can get the error message normally?

ps: cannot be returned in this way: background status code 200, and then put {code: 500}

in the data.
Sep.03,2021

ajax error callback

axios.get('/user/12345')
  .catch(function (error) {
    if (error.response) {
      //  2xx 
      console.log(error.response.data);
      console.log(error.response.status);
      console.log(error.response.headers);
    } else {
      // Something happened in setting up the request that triggered an Error
      console.log('Error', error.message);
    }
    console.log(error.config);
  });
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-1b3ac47-2c237.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-1b3ac47-2c237.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?