Browse Source

added more detail into error messages

lotus 8 months ago
parent
commit
d3667f5357
1 changed files with 4 additions and 0 deletions
  1. 4 0
      simple-weather.rb

+ 4 - 0
simple-weather.rb

@@ -120,13 +120,17 @@ class ParseArgs
   
   private def check_args()
     if(!@args.key?(:key))
+      puts "No API key passed in:"
         return false
     elsif(!@args.key?(:location))
+      puts "No location specified:"
       return false
     else
       if(@args[:key].length != 32)
+        puts "Bad API key length:"
         return false
       elsif(@args.key?(:units) && (@args[:units] != 'i' || @args[:units] != 'm'))
+        puts "Bad units provided: use m or i"
         return false
       else
         return true