System.perspective.download fails to download larger file

I’ve got a script to generate an excel file from a Perspective Table data set, and when I have 158 rows, the download is ok. When I have 192 rows, I get the following error and I don’t get a download:

16:58:56.132 [connection-worker-7] WARN com.inductiveautomation.ignition.client.gateway_interface.GatewayConnectionManager -- Failed to deserialize push notification payload for listener 'com.inductiveautomation.perspective.show-error'
com.inductiveautomation.ignition.common.rpc.proto.ProtoSerializationException: Unable to deserialize com.inductiveautomation.perspective.common.messages.ErrorNotification; no deserializer found
	at com.inductiveautomation.ignition.common.rpc.proto.BuiltinAdapters.fallbackDeserializer(BuiltinAdapters.java:447)
	at com.inductiveautomation.ignition.common.rpc.proto.ProtoRpcSerializer.decodeValue(ProtoRpcSerializer.java:257)
	at com.inductiveautomation.ignition.common.rpc.proto.ProtoRpcSerializer.decodeValue(ProtoRpcSerializer.java:242)
	at com.inductiveautomation.ignition.common.rpc.proto.ProtoRpcSerializer.protoDecode(ProtoRpcSerializer.java:363)
	at com.inductiveautomation.ignition.common.rpc.proto.ProtoRpcSerializer.lambda$asPushNotificationDeserializer$1(ProtoRpcSerializer.java:446)
	at com.inductiveautomation.ignition.client.gateway_interface.AbstractGatewayConnection.fireInternal(AbstractGatewayConnection.java:3004)
	at com.inductiveautomation.ignition.client.gateway_interface.AbstractGatewayConnection.firePushNotificationInternal(AbstractGatewayConnection.java:2978)
	at com.inductiveautomation.ignition.client.gateway_interface.AbstractGatewayConnection.lambda$firePushNotifications$23(AbstractGatewayConnection.java:3034)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
	at com.inductiveautomation.ignition.common.util.ExecutionQueue$PollAndExecute.run(ExecutionQueue.java:237)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.inductiveautomation.perspective.common.messages.ErrorNotification
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:1069)
	at org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:1103)
	at com.inductiveautomation.ignition.common.rpc.proto.BuiltinAdapters.fallbackDeserializer(BuiltinAdapters.java:442)
	... 12 common frames omitted

The most relevant part of the script is this:

	exportData = system.dataset.toDataset(headersLayman, exportData)
	
	spreadsheet = system.dataset.toExcel(True, [exportData])
	
	fileName = 'AuditLogExport_{}.xlsx'.format(system.date.format(system.date.now(), "yyyy-MM-dd HH:mm:ss"))
	system.perspective.download(fileName, spreadsheet)

I have error handling around my code and it prints any errors to the console, but this one doesn’t show up in the browser. I saw this appear in the Designer console when I tested it.

Nevermind, it was a java error:

INFO Perspective.Designer.Workspace -- java.lang.IllegalArgumentException: The maximum length of cell contents (text) is 32767 characters