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:
Sebastian Serth
2022-12-23 13:05:39 +01:00
parent 6a942ccf50
commit b80d372c53

View File

@ -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