freedomofpress / dangerzone

Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs
https://dangerzone.rocks/
GNU Affero General Public License v3.0
3.72k stars 172 forks source link

Qubes: Error handling #430

Closed deeplow closed 1 year ago

deeplow commented 1 year ago

We need to accommodate exceptions for all edge-cases in the client binary-protocol-parsing code. This was out of scope of the alpha stage (https://github.com/freedomofpress/dangerzone/issues/411).

Errors to check on server:

Errors to check on the client:

Errors to check on the client:

Also, we need to sanitize tracebacks and errors from the disposable qube, in a way that does not affect the user's terminal (e.g., remove control characters). update: this will be done in https://github.com/freedomofpress/dangerzone/pull/386

deeplow commented 1 year ago

I moved the "number of pages received" to be a server-side check. The client won't have a way of knowing this.

apyrgio commented 1 year ago

Note that it's possible that one of our read functions may receive an early EOF, when its the process in the disp qube that has died. In that case, we should always check first the exit code of the process, and then raise the proper exception.

apyrgio commented 1 year ago

We were a bit overeager to close this issue, as there are still some error cases that are missing: