From 760a805a9f56d3df0d4b83bd4a5a6476eb3aeb29 Mon Sep 17 00:00:00 2001 From: schneems Date: Fri, 17 Nov 2017 10:00:52 -0600 Subject: [PATCH 1/2] =?UTF-8?q?Use=20word=20=E2=80=9Cerror=E2=80=9D=20in?= =?UTF-8?q?=20error=20class.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subclassed from original error incase anyone was rescuing it. --- lib/sprockets/rails/helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sprockets/rails/helper.rb b/lib/sprockets/rails/helper.rb index 62491dfc..8c7b5f12 100644 --- a/lib/sprockets/rails/helper.rb +++ b/lib/sprockets/rails/helper.rb @@ -7,8 +7,9 @@ module Sprockets module Rails module Helper class AssetNotFound < StandardError; end + class AssetNotPrecompiled < StandardError; end - class AssetNotPrecompiled < StandardError + class AssetNotPrecompiledError < AssetNotPrecompiled include Sprockets::Rails::Utils def initialize(source) msg = From 3c7ff8a1aed028ae32210aabcbf6c25ed265695c Mon Sep 17 00:00:00 2001 From: schneems Date: Fri, 17 Nov 2017 10:01:39 -0600 Subject: [PATCH 2/2] Extra newline in exception ``` Sprockets::Rails::Helper::AssetNotPrecompiled: Asset `application.scss` was not declared to be precompiled in production. Declare links to your assets in `app/assets/config/manifest.js`. //= link application.scss and restart your server ``` Becomes ``` Sprockets::Rails::Helper::AssetNotPrecompiled: Asset `application.scss` was not declared to be precompiled in production. Declare links to your assets in `app/assets/config/manifest.js`. //= link application.scss and restart your server ``` --- lib/sprockets/rails/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sprockets/rails/helper.rb b/lib/sprockets/rails/helper.rb index 8c7b5f12..01f9f7e9 100644 --- a/lib/sprockets/rails/helper.rb +++ b/lib/sprockets/rails/helper.rb @@ -16,7 +16,7 @@ def initialize(source) if using_sprockets4? "Asset `#{ source }` was not declared to be precompiled in production.\n" + "Declare links to your assets in `app/assets/config/manifest.js`.\n\n" + - " //= link #{ source }\n" + + " //= link #{ source }\n\n" + "and restart your server" else "Asset was not declared to be precompiled in production.\n" +