Comments (7)
Got it. So we practically need a try: ... except Exception: log.exception
at the top level, that would log any stray exceptions from the exception blocks you pointed out.
from dangerzone.
Indeed. IIUC this wrapping handler should also mark the document as failed upon exception (if it was not done already) to correctly report it at the end.
from dangerzone.
Cool! Hopefully this issue provides enough context. In a nutshell, we want to:
- Catch and report all stray conversion exceptions from
IsolationProvider.convert
. - Mark the related document as failed.
Happy to answer any question you may have 🙂
from dangerzone.
Setting up the environment might take a while because I'm busy right now
from dangerzone.
Thanks a lot for bringing this issue to our attention, and for writing a test case.
I agree that the generator result should be consumed in principle, but we catch and log all exceptions (as you've already pointed out) here. I have to dig deeper, but my bet would be that there's a different underlying cause :-/.
from dangerzone.
but we catch and log all exceptions (as you've already pointed out) here
FWIW, I've ran into this in CLI tests when dummy conversion is used. The Dummy
isolation provider overrides the convert
method and does not have any exception handling.
I do not have a test case when using e.g. the container isolation provider (which IIUC uses the convert
method defined on the base isolation provider), but the two sections (here and here (come to think of it, it also applies to the except errors.ConverterProcException
and except errors.ConversionException
blocks as well)) I've mentioned could hide exceptions if an exception were to occur inside them, since those sections are not inside a try
/except
(this part is inside the except Exception
block, but any potential exception coming from inside the except
block is not handled (there is no exception handling in convert_doc
) and would be swallowed by exception.map
).
To simulate a swallowed exception when using the container provider, we would have to raise it explicitly. E.g. try adding 1 / 0
here (before the try
block). Running dev_scripts/dangerzone-cli /tmp/sample.pdf
then results in:
╭──────────────────────────╮
│ ▄██▄ │
│ ██████ │
│ ███▀▀▀██ │
│ ███ ████ │
│ ███ ██████ │
│ ███ ▀▀▀▀████ │
│ ███████ ▄██████ │
│ ███████ ▄█████████ │
│ ████████████████████ │
│ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ │
│ │
│ Dangerzone v0.6.0 │
│ https://dangerzone.rocks │
╰──────────────────────────╯
[INFO ] Assigning ID '0sHZEe' to doc '/tmp/sample.pdf'
Converting document to safe PDF
[DEBUG] Marking doc 0sHZEe as 'converting'
from dangerzone.
I'm interested in contributing to this
from dangerzone.
Related Issues (20)
- Detect default application for opening PDFs HOT 1
- Code scanning currently failing with dependabot.
- Add Dangezone source in our signed assets
- Unable to run podman inside containers when using silicon mac HOT 1
- Install poetry-plugin-export, as it will not be installed by default in future poetry versions
- Fix outstanding CI issues on the `main` branch HOT 1
- Add CI tests for .deb/.rpm packages that wil be shipped to users HOT 2
- Segfault HOT 1
- Qubes isolation provider contains Python >= 3.11 methods HOT 2
- HelloGitHub Badge
- QA and Release version 0.7.0 HOT 1
- Handle seccomp policies that don't include ptrace(2) HOT 2
- Use python 3.12 for Windows and macOS builds
- Install PyMuPDF via the prebuilt Python wheels for musl
- The `docker kill` command may hang during container termination
- [Feature Request] Kali Linux support is it possible to support it for the apt 3rd party repository ? HOT 2
- Should we trust CA certificates?
- Dangerzone not compatible with colima? HOT 6
- Scope UX improvements
- Dangerzone 0.7.0 on Linux Mint 21.3 does not work HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dangerzone.