• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

D wrapper around (some) of the pixiv web API


Commit MetaInfo

Révision8b0d2e3157470ef5551bd38769d144ffbbe4216a (tree)
l'heure2023-01-21 17:22:30
Auteursupercell <stigma@disr...>
Commitersupercell

Message de Log

Add PixivMagickException

The primary purpose for this (ATM) is to notify library user
that we could not open the GraphicsMagick library.

Change Summary

Modification

--- a/source/pixivd/client.d
+++ b/source/pixivd/client.d
@@ -14,8 +14,8 @@ import pixivd.enums;
1414 import pixivd.mixins;
1515 import pixivd.types;
1616
17-public enum PixivDVersion = 0.7;
18-public enum PixivDVersionString = "0.7";
17+public enum PixivDVersion = 0.8;
18+public enum PixivDVersionString = "0.8";
1919
2020 /**
2121 *
@@ -477,6 +477,14 @@ public:
477477 * illust = Illustration to download
478478 * directory = Directory where to save the Illustration
479479 * overwrite = Overwrite existing file(s)?
480+ *
481+ * Throws:
482+ * * `FileException` when the image file (or directory) already exists.
483+ * * `PixivMagickException` on failure to dynamically load GraphicsMagick.
484+ * * `PixivJSONException` on error parsing JSON or with API request.
485+ * * `PixivException` on other Pixiv-related errors.
486+ * * `Exception` if trying to download Novel (NotImplemented) or any other exception.
487+ *
480488 */
481489 void downloadIllust(Illustration illust, string directory, bool overwrite = false)
482490 {
@@ -898,7 +906,7 @@ private:
898906 loadGraphicsMagick(libgm);
899907
900908 if (null is libgm) {
901- throw new PixivException("No GraphicsMagick library found.");
909+ throw new PixivMagickException("No GraphicsMagick library found.");
902910 }
903911 }
904912
--- a/source/pixivd/types/pixiv_exception.d
+++ b/source/pixivd/types/pixiv_exception.d
@@ -8,6 +8,16 @@ class PixivException : Exception
88 }
99 }
1010
11+/// Currently only used in downloadIllust to notify
12+/// that Dynamically loading GraphicsMagick returned null.
13+class PixivMagickException : PixivException
14+{
15+ this(string msg)
16+ {
17+ super(msg);
18+ }
19+}
20+
1121 /// Exception with the JSON response.
1222 class PixivJSONException : PixivException
1323 {