From 3a2145dfdd1b5eb6648f3e27edbf6a5cba2dd35a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 18 Apr 2022 18:26:41 -0400 Subject: [PATCH] Return no data error as atom instead of string --- lib/feed_parser.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/feed_parser.ex b/lib/feed_parser.ex index 57781b4..fb510a4 100644 --- a/lib/feed_parser.ex +++ b/lib/feed_parser.ex @@ -22,11 +22,11 @@ defmodule FeedParser do An extended set of parsers may also be provided, otherwise the default set (supporting RSS 2.0, Atom, JSON Feed, and RSS-in-JSON) will be used. Parsers are modules that implement the `FeedParser.Parser` behaviour. """ @spec parse(data :: String.t(), content_type :: String.t(), parsers :: [module()]) :: - {:ok, feed :: FeedParser.Feed.t()} | {:error, reason :: String.t()} + {:ok, feed :: FeedParser.Feed.t()} | {:error, reason :: term()} def parse(data, content_type, parsers \\ @default_parsers) def parse(nil, _, _) do - {:error, "no data"} + {:error, :no_data} end def parse(data, content_type, parsers) when is_binary(data) do