5. Verifica si la conexión terminó con éxito

index.html

const respuesta =
 await fetch("servicio.php")
if (respuesta.ok) {
 const texto =
  await respuesta.text()
 alert(texto)
} else {
 throw new Error(
  respuesta.statusText)
}

Memoria

resp
ok
true
text
Hola
skip_previous skip_next