mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
DEV: show no icon if icon name is missing and log at error level (#31866)
On 1st April 2025, we start showing no icons if the icon name used is a deprecated one and therefore no longer part of the svg set. We'll continue showing the messages with the correct icon name to aid correction of these names. Console logging will now be done at an error level for such icons. We retain the behaviour of raising an error for such icons in plugins from svg_sprite.rb in test environments, but removed this from icon-library.js as it's harder to test the actual expected behaviour of returning the original icon now that it's not part of the deprecation workflow. (sinon.stub doesn't work well here for `isTesting` - the alternative would be to override the environment.js module with `proxyquire`) In any case, once we remove the mapping logic, we won't be raising errors in test environment either for this scenario.
This commit is contained in:
@ -117,6 +117,7 @@ module Discourse
|
||||
|
||||
class CommandError < RuntimeError
|
||||
attr_reader :status, :stdout, :stderr
|
||||
|
||||
def initialize(message, status: nil, stdout: nil, stderr: nil)
|
||||
super(message)
|
||||
@status = status
|
||||
@ -305,6 +306,9 @@ module Discourse
|
||||
class Deprecation < StandardError
|
||||
end
|
||||
|
||||
class MissingIconError < StandardError
|
||||
end
|
||||
|
||||
class ScssError < StandardError
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user