Sha256: d258d23cebbbbe454f60aec5e730ce0bb7a821a81a0b42bcc7bc839554c94b97

Contents?: true

Size: 443 Bytes

Versions: 2

Compression:

Stored size: 443 Bytes

Contents

module Analytics
  class ErrorHandler
    class << self
      def rescuable
        yield
      rescue StandardError => e
        handle(e)
      end

      def handle(e)
        prompt.error(
          case e
          when Errno::ENOENT
            "We could not find a file that we need:\n\n#{e.message}"
          else
            "An error happened. This might help:\n\n#{e.message}"
          end
        )
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ios_analytics_cli-1.1.0 lib/ios_analytics_cli/error_handler.rb
ios_analytics_cli-1.0.0 lib/ios_analytics_cli/error_handler.rb