title: Whether all error messages should come from the backend in a form that can be shown to the user?
body: <p>The situation is such that I use the axios library and interceptors of successful and unsuccessful requests in order to automatically pick up and display an alert with the error text from the server in case of an error.<br>
  So my backend developer sends me error messages that are not suitable for output to an alert arguing that the message is I have to generate the error myself, but what comes from the server is only needed so that I know about the error. Is he right, or sending an error message from the backend should go strictly like <code>response.message</code> and match the error format displayed to the user on the UI?</p>
  <p>The universal error interceptor that I spoke about looks like this, but the errors that it sends to me each time are on a different path, while their format is not suitable for displaying to the user, and often an array with errors comes to the request. Is he doing the right thing?</p>
  <p>Because in that case, I cannot use the code below to handle errors</p>
  <pre><code>const API = axios.create({
    baseURL: '/api/',
    responseType: 'json',
    headers: { 'cache': 'no-store' },
  })
  
  const onFulfilled = (response) =&gt; response.data
  
  
  const onRejected = (error) =&gt; {
    if (error.response?.status === 500) {
      notify(error.response.statusText || ' Internal server error', 'error')
    } else if (error.response?.data.message) {
      notify(error.response.data.message, 'error')
    } else {
      notify('Oops something went wrong', 'error')
    }
    ..... and so on
    return Promise.reject(error)
  }
  
  API.interceptors.response.use(onFulfilled, onRejected)
  </code></pre>