                 log '%s %s [%s/%s] %s', data.name, data.latest_version or '(no version)', data.owner, data.repo, data.desc
               else
                 log 'Package not found'.red
-          , (error) -> 
-            if error.code is 404
-              log 'Package not found'.red
-            else
-              log 'Error while trying to get the resource, server code:'.red, error.code or error
-            die 1
+          , error
 
       when 'create'
           

          .then (response) ->
            if response.code is 201
              log 'Package created successfully'.green
          , (error) ->
            if error.code is 409
              log 'The package already exists. Use --force to override it'.red
              # todo: delete package
            else
              log 'Cannot create the package, server code:'.red, error.code or error
            die 1

      when 'delete'


          .then (response) ->
            if response.code is 200
              log 'Package updated successfully'.green
          , error

      when 'url'

        if not pkgname
          log '"--package" name option required. Type --help'.red
          die 1

        client.getPackageUrl(pkgname)
          .then (response) ->
            if response.code isnt 200
              log 'Package not found'.red
            else

          , error

      else
        log "Invalid '#{action}' action. Type --help".red
