diff --git a/lib/fcm.rb b/lib/fcm.rb index 16403c1..c29008a 100644 --- a/lib/fcm.rb +++ b/lib/fcm.rb @@ -295,16 +295,17 @@ def jwt_token def credentials_error_msg(param) error_msg = 'credentials must be an IO-like ' \ - 'object or path You passed' + 'object or path ' param_type = '' if param.nil? - param_type = " nil" + param_type = ' You passed nil' else - param_type = "a #{param.class.name}" + param_type = " You passed a #{param.class.name}" end - - raise InvalidCredentialError, "#{error_msg} #{param_type}" + + error_msg += param_type + raise InvalidCredentialError, error_msg end def filename_or_io_like?(path)