docbrown/app/services/error_messages/clean.rb
Anna Buianova 26592a3a9c
Removing Settings::General.email_addresses (#13958)
* Replaced Settings::General.email_addresses with Forem.email

* Removed Settings::General.email_addresses remainders

* Fixed schema.rb

* Remove Settings::General.email_addresses record

* Fixed label for default email
2021-06-11 12:34:34 +03:00

15 lines
502 B
Ruby

module ErrorMessages
class Clean
FRONTMATTER_ERROR = /expected key while parsing a block mapping at line/.freeze
REPLACEMENT_ERROR = "There was a problem parsing the front-matter YAML. " \
"Perhaps you need to escape a quote or a colon or something. " \
"Email %s if you are having trouble.".freeze
def self.call(error_message)
return error_message unless error_message.match?(FRONTMATTER_ERROR)
format(REPLACEMENT_ERROR, ForemInstance.email)
end
end
end