Skip to content

Commit 6462a34

Browse files
committed
Bring back nil check for constructing credential error msg
1 parent bb13556 commit 6462a34

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/fcm.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,14 @@ def jwt_token
295295

296296
def credentials_error_msg(param)
297297
error_msg = 'credentials must be an IO-like ' \
298-
'object or path You passed '
298+
'object or path '
299+
300+
if param.nil?
301+
error_msg += 'You passed nil'
302+
else
303+
error_msg += "You passed a #{param.class.name}"
304+
end
299305

300-
error_msg += param.class.name.to_s
301306
raise InvalidCredentialError, error_msg
302307
end
303308

0 commit comments

Comments
 (0)