Closed tresf closed 8 years ago
@bberenz I spent a couple hours on this and I'm in a tailspin trying to figure out why getException
never gets cleared.
Can you take a look? This is a core function that seems to have been broken since the release of QZ Tray.
I think your confusion came from the weird way we are handling exceptions in 1.9, because we always send a result when the exception value changes, even on null, and re-purpose it to be a property on a js object. https://github.com/qzind/qz-print/blob/1.9/src/qz/ws/PrintSocket.java#L352
@bberenz Thanks that was my first instinct, but now when you try to print an XPS document and "Cancel" at the "Save As" screen, it doesn't fire an exception because getLocalizedMessage
is null
. Shall we also add in an:
// pseudocode
if (qz.getException().getLocalizedMessage() == null) {
eMsg = qz.getException().getClass().getName(); // or perhaps "Unknown Error"
}
Yes, we should. I've added it under 9a9fa61190db52d4938b0ab8651faa63ef24436c.
:+1:
Quoting the original bug report which came in via email:
The offending code appears to be here:
https://github.com/qzind/qz-print/blob/1.9/js/qz-websocket.js#L189:L197