Why is every 400+ status code triggering onerror?
function postDto(dto) { const xhr = new XMLHttpRequest(); xhr.open(“POST”, api_url + “/scores/json”); xhr.setRequestHeader(“Content-Type”, “application/json”); xhr.onreadystatechange = () => { if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.status === 200) postresponse = “Commit successful! View score ” + “<a href='” + app_url + “/score/” + scoreName + “‘>here</a>”; else postresponse = “Error: ” + xhr.status + ” […]