Forráskód Böngészése

LibPDF: Propagate errors in PDFFont::create()

Julian Offenhäuser 2 éve
szülő
commit
2a70ea3ee7
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      Userland/Libraries/LibPDF/Fonts/PDFFont.cpp

+ 2 - 2
Userland/Libraries/LibPDF/Fonts/PDFFont.cpp

@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: BSD-2-Clause
  */
 
+#include <AK/String.h>
 #include <LibGfx/Font/FontDatabase.h>
 #include <LibPDF/CommonNames.h>
 #include <LibPDF/Fonts/PDFFont.h>
@@ -83,8 +84,7 @@ PDFErrorOr<NonnullRefPtr<PDFFont>> PDFFont::create(Document* document, NonnullRe
     if (subtype == "TrueType")
         return TRY(TrueTypeFont::create(document, dict, font_size));
 
-    dbgln("Unknown font subtype: {}", subtype);
-    TODO();
+    return Error(Error::Type::Internal, TRY(String::formatted("Unhandled font subtype: {}", subtype)).to_deprecated_string());
 }
 
 Tuple<DeprecatedString, DeprecatedString> PDFFont::replacement_for_standard_latin_font(StringView name)