Skip to content

Commit

Permalink
add error message when domain parsing errors out
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhgupta committed Mar 28, 2020
1 parent a74d938 commit 6dcdfb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mail_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ module MailProvider
ROOT_DIR = File.dirname(File.dirname(__FILE__))

class Error < StandardError; end
class TrieLoadError < StandardError; end
class ClientError < Error; end
class ServerError < Error; end
class TrieLoadError < ServerError; end
class DomainParsingError < ClientError; end
end

require 'faraday'
Expand Down
2 changes: 2 additions & 0 deletions lib/mail_provider/checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def check(str, summarize: false)

add_score_to_response
@response
rescue PublicSuffix::Error => e
raise DomainParsingError, e.message
end

def find(str)
Expand Down

0 comments on commit 6dcdfb0

Please sign in to comment.