Use the `onerror` callback here instead