Adding onerror handler for resource load failures. Covers 4xx & 5xx responses