Sha256: 332712219c2a72f6a1ab7f06addca7eed50083eb93ae7f13849392bb8a90336d
Contents?: true
Size: 504 Bytes
Versions: 7
Compression:
Stored size: 504 Bytes
Contents
module SendGridMailer class Error < RuntimeError end class InvalidApiKey < Error def initialize super("The SendGrid API key is invalid or missing") end end class ApiError < Error attr_reader :error_code, :errors def initialize(error_code, errors) @error_code = error_code @errors = errors error_message = errors.map { |err| err['message'] }.join('. ') super("Sendgrid API error. Code: #{error_code}. Errors: #{error_message}") end end end
Version data entries
7 entries across 7 versions & 1 rubygems