summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibPDF
diff options
context:
space:
mode:
authorRodrigo Tobar <rtobar@icrar.org>2022-12-14 23:10:26 +0800
committerAndreas Kling <kling@serenityos.org>2022-12-16 10:04:23 +0100
commitc4bc27f27489cdc062468eea53b18f1e6e5db716 (patch)
tree2cb7ec54eeb90040575c6e82149f62ec7c2244c5 /Userland/Libraries/LibPDF
parente87fecf710cf2e8af1a58c317bd9911e01322a9b (diff)
downloadserenity-c4bc27f27489cdc062468eea53b18f1e6e5db716.zip
LibPDF: Don't abort on unsupported drawing operations
Instead of calling TODO(), which will abort the program, we now return an Error specifying that we haven't implemented the drawing operation yet. This will now nicely trickle up all the way through to the PDFViewer, which will then notify its clients about the problem.
Diffstat (limited to 'Userland/Libraries/LibPDF')
-rw-r--r--Userland/Libraries/LibPDF/Renderer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp
index 1cc8186e9b..6c8f434a42 100644
--- a/Userland/Libraries/LibPDF/Renderer.cpp
+++ b/Userland/Libraries/LibPDF/Renderer.cpp
@@ -13,11 +13,10 @@
#define RENDERER_HANDLER(name) \
PDFErrorOr<void> Renderer::handle_##name([[maybe_unused]] Vector<Value> const& args, [[maybe_unused]] Optional<NonnullRefPtr<DictObject>> extra_resources)
-#define RENDERER_TODO(name) \
- RENDERER_HANDLER(name) \
- { \
- dbgln("[PDF::Renderer] Unsupported draw operation " #name); \
- TODO(); \
+#define RENDERER_TODO(name) \
+ RENDERER_HANDLER(name) \
+ { \
+ return Error(Error::Type::RenderingUnsupported, "draw operation: " #name); \
}
namespace PDF {