Sha256: 3c40932b583ee966497aa1fe9e04c1e1a14e41d50fdef811c21fa090373d1638

Contents?: true

Size: 835 Bytes

Versions: 93

Compression:

Stored size: 835 Bytes

Contents

# frozen_string_literal: true

require "pathname"

module SassC

  class BaseError < StandardError; end
  class NotRenderedError < BaseError; end
  class InvalidStyleError < BaseError; end
  class UnsupportedValue < BaseError; end

  # When dealing with SyntaxErrors,
  # it's important to provide filename and line number information.
  # This will be used in various error reports to users, including backtraces.

  class SyntaxError < BaseError

    def initialize(message, filename: nil, line: nil)
      @filename = filename
      @line = line
      super(message)
    end

    def backtrace
      return nil if super.nil?
      sass_backtrace + super
    end

    # The backtrace of the error within Sass files.
    def sass_backtrace
      return [] unless @filename && @line
      ["#{@filename}:#{@line}"]
    end

  end

end

Version data entries

93 entries across 77 versions & 7 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/lib/sassc/error.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.0.1/lib/sassc/error.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc/error.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/lib/sassc/error.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/lib/sassc/error.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.0.1/lib/sassc/error.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.0/lib/sassc/error.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc/error.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.0.1/lib/sassc/error.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/lib/sassc/error.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.0/lib/sassc/error.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc/error.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.0.1/lib/sassc/error.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/lib/sassc/error.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.0/lib/sassc/error.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sassc-2.2.1/lib/sassc/error.rb
sassc-2.2.1-x86-mingw32 lib/sassc/error.rb
sassc-2.2.1-x64-mingw32 lib/sassc/error.rb
sassc-2.2.1 lib/sassc/error.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sassc-2.0.1/lib/sassc/error.rb