If mg.onerror returns non-0, processing will abort.