I have this code snippet when I get an error from ...
# đź’»developers
t
I have this code snippet when I get an error from the API call I want to set error_msg variable to a certain text When I try to show as text in the chat it's set as null
Copy code
.catch((error) => {
    if (error.response && error.response.data.title === 'Member Exists') {
      workflow.error_msg = "Error"
      console.error(workflow.error_msg)
    } else {
      console.error('Error:', error.response ? error.response.data : error.message)
    }
  })