fcmpush icon indicating copy to clipboard operation
fcmpush copied to clipboard

Raise custom error if missing configuration

Open lucascarrias opened this issue 3 years ago • 1 comments

This is an improvement suggestion.

How?

  • #push method is called
  • config.json_key_io is nil
  • Some Google's env var is nil

Reference: https://github.com/miyataka/fcmpush#usage

What?

The following error is raised:

NoMethodError:
 undefined method `gsub' for nil:NilClass

Suggestion

Rescue the NoMethodError and raises a custom error with information regarding the missing configuration


Thanks for your time and for the good work.

lucascarrias avatar Apr 08 '21 16:04 lucascarrias

@LucasCarrias Thanks for your suggestion. That's sounds good. It helps that fcmpush newbie.

miyataka avatar Apr 11 '21 10:04 miyataka