def METHOD_NAME(self, reply: QNetworkReply, error: QNetworkReply.NetworkError) -> None:
    """Handles an error uploading."""
    body = bytes(reply.peek(reply.bytesAvailable())).decode()
    Logger.log("e", "Received error while uploading: %s", body)
    self._on_error(self._file_name, reply, error)
    self.stop()