Prevent errors with unavailable linter translations
Not all testing frameworks provide a translation for Linter (or linter support at all). For these, we don't want to call the non-existing method but rather return the same messages as before.
This commit is contained in:
@ -30,7 +30,7 @@ class Assessor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def translate_linter(result, locale)
|
def translate_linter(result, locale)
|
||||||
@testing_framework_adapter.translate_linter(result, locale)
|
@testing_framework_adapter.try(:translate_linter, result, locale) || result
|
||||||
end
|
end
|
||||||
|
|
||||||
class Error < RuntimeError; end
|
class Error < RuntimeError; end
|
||||||
|
Reference in New Issue
Block a user