Sha256: 6cf89ab6dae49a66aebe0fa5174ff22fe6f684f44da6ddc7c4a2adcc1e0e6c2f

Contents?: true

Size: 955 Bytes

Versions: 14

Compression:

Stored size: 955 Bytes

Contents

# frozen_string_literal: false

# Custom errors.
#
# @private
class USPSFlags
  class Errors
    class PNGGenerationError < StandardError
      attr_reader :svg

      def initialize(msg = 'There was an error generating the PNG file.', svg: '')
        super(msg)
        @svg = svg
      end
    end

    class PNGConversionError < StandardError
      def initialize(msg = 'There was an error converting the PNG file.')
        super(msg)
      end
    end

    class StaticFilesGenerationError < StandardError
      attr_reader :cause

      def initialize(msg = 'There was an error generating the static files.', cause: nil)
        super(msg)
        @cause = cause
      end
    end

    class ZipGenerationError < StandardError
      attr_reader :type, :cause

      def initialize(msg = 'There was an error generating the zip file.', type: nil, cause: nil)
        super(msg)
        @type = type
        @cause = cause
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
usps_flags-0.6.4 lib/usps_flags/errors.rb
usps_flags-0.6.3 lib/usps_flags/errors.rb
usps_flags-0.6.2 lib/usps_flags/errors.rb
usps_flags-0.6.1 lib/usps_flags/errors.rb
usps_flags-0.6.0 lib/usps_flags/errors.rb
usps_flags-0.5.9 lib/usps_flags/errors.rb
usps_flags-0.5.8 lib/usps_flags/errors.rb
usps_flags-0.5.7 lib/usps_flags/errors.rb
usps_flags-0.5.6 lib/usps_flags/errors.rb
usps_flags-0.5.5 lib/usps_flags/errors.rb
usps_flags-0.5.4 lib/usps_flags/errors.rb
usps_flags-0.5.3 lib/usps_flags/errors.rb
usps_flags-0.5.2 lib/usps_flags/errors.rb
usps_flags-0.5.1 lib/usps_flags/errors.rb