diff --git a/comic/download.go b/comic/download.go index af4ba34..8fe8cb7 100644 --- a/comic/download.go +++ b/comic/download.go @@ -11,6 +11,15 @@ import ( cloudflarebp "github.com/DaRealFreak/cloudflare-bp-go" ) +type ComicDownloadError struct { + Message string + Code int +} + +func (c ComicDownloadError) Error() string { + return c.Message +} + // downloadFile downloads a file from a given URL and saves it to a specified location. // // The function takes a URL string, a page number, and a Comic struct as parameters. diff --git a/comic/error.go b/comic/error.go deleted file mode 100644 index 2515132..0000000 --- a/comic/error.go +++ /dev/null @@ -1,19 +0,0 @@ -package comic - -type ImageParseError struct { - Message string - Code int -} - -type ComicDownloadError struct { - Message string - Code int -} - -func (i ImageParseError) Error() string { - return i.Message -} - -func (c ComicDownloadError) Error() string { - return c.Message -} diff --git a/comic/parser.go b/comic/parser.go index 97e6870..da8429b 100644 --- a/comic/parser.go +++ b/comic/parser.go @@ -8,6 +8,15 @@ import ( "github.com/PuerkitoBio/goquery" ) +type ImageParseError struct { + Message string + Code int +} + +func (i ImageParseError) Error() string { + return i.Message +} + // Markup retrieves the HTML content from a given URL and returns a goquery Document. // // url is the URL to retrieve the HTML content from.